vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.73k forks source link

when user selects text, and mouseup occurs outside of input element, onblur submit is triggered in >chrome 73 #1140

Open dazusu opened 4 years ago

dazusu commented 4 years ago

Since Chrome 73, if a user attempts to start selecting text with the mouse in an input, then "mouseup"'s outside of the input, onblur submit is triggered.

This doesn't happen in other browsers, and is only present in Chrome 73+.

Video: https://recordit.co/DExC3xBfmU

rherzfeld commented 3 years ago

I came up with the following workaround. Set onblur: 'ignore' and handle the blur as follows:


$('body').on('blur',` '.editable-input input', function () {
    $(this).closest('form').submit();
});