OO.ui.ButtonWidget doesn't take focus itself, so clicking the "Make
request" button isn't sending the blur event, so stuff like
OO.ui.CapsuleMultiSelectWidget doesn't get to process its input until
too late.
Bug: T128054
Change-Id: I00913123e0019c096890b2829bfea3a77c551b2e
* Submit button handler
*/
sendRequest: function () {
* Submit button handler
*/
sendRequest: function () {
- var page, subpages, i, query, $result,
+ var page, subpages, i, query, $result, $focus,
progress, $progressText, progressLoading,
deferreds = [],
params = {},
displayParams = {},
checkPages = [ pages.main ];
progress, $progressText, progressLoading,
deferreds = [],
params = {},
displayParams = {},
checkPages = [ pages.main ];
+ // Blur any focused widget before submit, because
+ // OO.ui.ButtonWidget doesn't take focus itself (T128054)
+ $focus = $( '#mw-apisandbox-ui' ).find( document.activeElement );
+ if ( $focus.length ) {
+ $focus[ 0 ].blur();
+ }
+
suppressErrors = false;
while ( checkPages.length ) {
suppressErrors = false;
while ( checkPages.length ) {