File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -89,12 +89,6 @@ export default class Input {
89
89
} ) ;
90
90
}
91
91
92
- // when used in a single-page app,
93
- // hide datepicker when the browser's back button is pressed
94
- this . element . addEventListener ( "hashchange" , ( ) = > {
95
- thePicker . hide ( ) ;
96
- } )
97
-
98
92
getLocaleText ( ) {
99
93
const locale = this . locale . toLowerCase ( ) ;
100
94
Original file line number Diff line number Diff line change @@ -129,6 +129,12 @@ class Picker {
129
129
document . addEventListener ( `mousedown` , this . removeClickOut ) ;
130
130
document . addEventListener ( `touchstart` , this . removeClickOut ) ;
131
131
} , 500 ) ;
132
+
133
+ // when used in a single-page app or otherwise,
134
+ // hide datepicker when the browser's back button is pressed
135
+ window . onpopstate = ( ) => {
136
+ this . hide ( ) ;
137
+ }
132
138
}
133
139
134
140
// Position picker below element. Align to element's right edge.
You can’t perform that action at this time.
0 commit comments