File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,14 @@ class DayPickerKeyboardShortcuts extends React.PureComponent {
102102 this . handleFocus ( ) ;
103103 }
104104
105+ handleFocus ( ) {
106+ if ( this . hideKeyboardShortcutsButton ) {
107+ // automatically move focus into the dialog by moving
108+ // to the only interactive element, the hide button
109+ this . hideKeyboardShortcutsButton . focus ( ) ;
110+ }
111+ }
112+
105113 onKeyDown ( e ) {
106114 e . stopPropagation ( ) ;
107115
@@ -152,14 +160,6 @@ class DayPickerKeyboardShortcuts extends React.PureComponent {
152160 this . hideKeyboardShortcutsButton = ref ;
153161 }
154162
155- handleFocus ( ) {
156- if ( this . hideKeyboardShortcutsButton ) {
157- // automatically move focus into the dialog by moving
158- // to the only interactive element, the hide button
159- this . hideKeyboardShortcutsButton . focus ( ) ;
160- }
161- }
162-
163163 render ( ) {
164164 const {
165165 block,
You can’t perform that action at this time.
0 commit comments