File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -782,6 +782,10 @@ function initArrowHorizontalNav(){
782782 var scrollEnd = 0 ;
783783 document . addEventListener ( 'keydown' , function ( event ) {
784784 if ( ! event . shiftKey && ! event . ctrlKey && ! event . altKey && ! event . metaKey ) {
785+ var f = event . target . matches ( formelements ) ;
786+ if ( f ) {
787+ return ;
788+ }
785789 if ( event . which == dir_key_start ) {
786790 if ( ! scrollStart && + el . scrollLeft . toFixed ( ) * dir_scroll <= 0 ) {
787791 prev && prev . click ( ) ;
@@ -804,6 +808,10 @@ function initArrowHorizontalNav(){
804808 } ) ;
805809 document . addEventListener ( 'keyup' , function ( event ) {
806810 if ( ! event . shiftKey && ! event . ctrlKey && ! event . altKey && ! event . metaKey ) {
811+ var f = event . target . matches ( formelements ) ;
812+ if ( f ) {
813+ return ;
814+ }
807815 if ( event . which == dir_key_start ) {
808816 // check for false indication if keyup is delayed after navigation
809817 if ( scrollStart == - 1 ) {
@@ -817,15 +825,6 @@ function initArrowHorizontalNav(){
817825 }
818826 }
819827 } ) ;
820-
821- // avoid keyboard navigation for input fields
822- document . querySelectorAll ( formelements ) . forEach ( function ( e ) {
823- e . addEventListener ( 'keydown' , function ( event ) {
824- if ( event . which == dir_key_start || event . which == dir_key_end ) {
825- event . stopPropagation ( ) ;
826- }
827- } ) ;
828- } ) ;
829828}
830829
831830function initMenuScrollbar ( ) {
You can’t perform that action at this time.
0 commit comments