Make WordPress Core

Ticket #28908: 28908.1.diff

File 28908.1.diff, 678 bytes (added by Nessworthy, 11 years ago)

First pass in an attempt to fix firefox's autocomplete bug affecting adding custom menu links. The patch was based on the answer of the linked StackOverflow question: http://stackoverflow.com/questions/2303955/i-have-a-problem-with-keydown-event-and-autocomplete-in-firebox-on-mac

  • wp-admin/js/nav-menu.js

     
    788788                        $('#add-custom-links input[type="text"]').keypress(function(e){
    789789                                if ( e.keyCode === 13 ) {
    790790                                        e.preventDefault();
    791                                         $( '#submit-customlinkdiv' ).click();
     791
     792                                        /*
     793                                        Workaround for Mozilla Firefox's autocomplete firing internal callbacks after the keypress event.
     794                                        https://bugzilla.mozilla.org/show_bug.cgi?id=286933
     795                                         */
     796                                        setTimeout(function() {
     797
     798                                                $( '#submit-customlinkdiv' ).click();
     799
     800                                        }, 0);
    792801                                }
    793802                        });
    794803                },