[MediaWiki-commits] [Gerrit] Don't use focus event for the search input - change (mediawiki...MobileFrontend)
JGonera has uploaded a new change for review. https://gerrit.wikimedia.org/r/60691 Change subject: Don't use focus event for the search input .. Don't use focus event for the search input Use touchend and keydown instead. This way the search overlay is shown only when someone taps the input or starts typing in it. The overlay is not shown anymore when someone uses Tab or Shift+Tab to navigate the page. Also fixes Kindle annoyances. Bug: 47499 Change-Id: I99347dd90a20e796551a1ce6aed47278fcb40c0e --- M javascripts/modules/search-2.js 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/91/60691/1 diff --git a/javascripts/modules/search-2.js b/javascripts/modules/search-2.js index daadb98..affa13f 100644 --- a/javascripts/modules/search-2.js +++ b/javascripts/modules/search-2.js @@ -108,8 +108,13 @@ function init() { var searchOverlay = new SearchOverlay(); - $( '#searchInput' ).on( 'focus', function() { - searchOverlay.showAndFocus(); + // don't use focus event (https://bugzilla.wikimedia.org/show_bug.cgi?id=47499) + $( '#searchInput' ).on( 'touchend keydown', function( ev ) { + var keyCode = ev.keyCode || ev.which; + // if touch or key not Tab or Shift + if ( ev.type === 'touchend' || ( keyCode !== 9 keyCode !== 16 ) ) { + searchOverlay.showAndFocus(); + } } ); } init(); -- To view, visit https://gerrit.wikimedia.org/r/60691 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99347dd90a20e796551a1ce6aed47278fcb40c0e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: JGonera jgon...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't use focus event for the search input - change (mediawiki...MobileFrontend)
JGonera has submitted this change and it was merged. Change subject: Don't use focus event for the search input .. Don't use focus event for the search input Use touchend and keydown instead. This way the search overlay is shown only when someone taps the input or starts typing in it. The overlay is not shown anymore when someone uses Tab or Shift+Tab to navigate the page. Also fixes Kindle annoyances. Bug: 47499 Change-Id: I99347dd90a20e796551a1ce6aed47278fcb40c0e --- M javascripts/modules/search-2.js 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: JGonera: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/javascripts/modules/search-2.js b/javascripts/modules/search-2.js index daadb98..766c50e 100644 --- a/javascripts/modules/search-2.js +++ b/javascripts/modules/search-2.js @@ -108,8 +108,12 @@ function init() { var searchOverlay = new SearchOverlay(); - $( '#searchInput' ).on( 'focus', function() { - searchOverlay.showAndFocus(); + // don't use focus event (https://bugzilla.wikimedia.org/show_bug.cgi?id=47499) + $( '#searchInput' ).on( 'touchend keydown', function( ev ) { + // if touch or key not Tab or Shift + if ( ev.type === 'touchend' || ( ev.which !== 9 ev.which !== 16 ) ) { + searchOverlay.showAndFocus(); + } } ); } init(); -- To view, visit https://gerrit.wikimedia.org/r/60691 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99347dd90a20e796551a1ce6aed47278fcb40c0e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: JGonera jgon...@wikimedia.org Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org Gerrit-Reviewer: JGonera jgon...@wikimedia.org Gerrit-Reviewer: Jdlrobson jrob...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits