* (bug 14082) Fix for complex text input vs AJAX suggestions on some browsers
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 14 May 2008 16:09:18 +0000 (16:09 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 14 May 2008 16:09:18 +0000 (16:09 +0000)
commitcf570f5b6b7fdd3c0a4fb4f4cf73c0c58611f6b7
tree10b24223d1441e62ab27f261a62ba54396990d69
parent5510874e984d89e013d664f5dfdb0eb80793c359
* (bug 14082) Fix for complex text input vs AJAX suggestions on some browsers

The mwsuggest code was doing a blur(); focus() on the text field the first time a key was pressed, as a workaround for a problem with Firefox when the field was focused at page load time, as on Special:Search with no input given.

Disabling of the browser's autosuggestion wasn't taking effect in Firefox without this workaround; however the extra blur() and focus() in some cases interrupted complex text input methods (for instance for Korean and Japanese), making it difficult to type in text. [Easily reproduceable in Safari on Mac.]

Unfortunately there's no good way to check if a field is focused from JavaScript, so we can't just conditionally do the blur/focus.

I've changed how Special:Search does its focus() of the input field; now instead of happening in raw immediate JS, it's done as a body onload handler -- this will run *after* mwsuggest.js does its setup, so by the time the field is forced focused, native autosuggest will be disabled.

There might conceivably be a race condition if the user manages to manually focus the field while the page is still loading. Not sure what we can do about that. :D
RELEASE-NOTES
includes/SpecialSearch.php
skins/common/mwsuggest.js