简体   繁体   中英

Hovering a textbox in a Menu/submenu item closes the item in the latest Chrome version

When the cursor enters a textbox that is inside of a submenu item, the respective submenu is closed. Observable only in the latest version of Google Chrome (55.0.2883.75 m).

Reproduction of the problem:

http://dojo.telerik.com/OvURe

http://dojo.telerik.com/ipihu/3

How can I solve this problem?

( Original Reference )

     input{
        pointer-events:none;
      }
    </style>
    <script>
        $(document).ready(function() {
            $("#menu").kendoMenu();


          $(document).on("click",".k-link",function(){
                 $(this).find('input').focus();
         });
        });

I could solve this with the following code:

function getChromeVersion() {     
        var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
        return raw ? parseInt(raw[2], 10) : false;
}
    function filterNormalInChrome() {
         $(".k-header-column-menu").on("click",function() {
              if (getChromeVersion() >= 55) {  //Chrome version
                 $("ul.k-widget.k-reset.k-header.k-menu.k-menu-vertical").each(function() {
                     $._data($(this).get(0), "events")["pointerout"][0] = 0;
                 });
              }
         });
    }
    $(window).load(function () {
        filterNormalInChrome();
    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM