File tree 1 file changed +21
-1
lines changed 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,12 @@ export default {
117
117
} else {
118
118
this . hideMenu ( ) ;
119
119
}
120
+ } ,
121
+ disabled ( state , old ) {
122
+ if ( state !== old && state && this . visible ) {
123
+ // Hide dropdown if disabled changes to true
124
+ this . visible = false ;
125
+ }
120
126
}
121
127
} ,
122
128
computed : {
@@ -239,13 +245,27 @@ export default {
239
245
this . $emit ( "click" , e ) ;
240
246
} ,
241
247
toggle ( ) {
242
- // Called only by a button that toggles teh menu
248
+ // Called only by a button that toggles the menu
243
249
if ( this . disabled ) {
244
250
this . visible = false ;
245
251
return ;
246
252
}
247
253
this . visible = ! this . visible ;
248
254
} ,
255
+ show ( ) {
256
+ // Public method to show dropdown
257
+ if ( this . disabled ) {
258
+ return ;
259
+ }
260
+ this . visible = true ;
261
+ } ,
262
+ hide ( ) {
263
+ // Public method to hide dropdown
264
+ if ( this . disabled ) {
265
+ return ;
266
+ }
267
+ this . visible = false ;
268
+ } ,
249
269
onTab ( ) {
250
270
if ( this . visible ) {
251
271
// TODO: Need special handler for dealing with form inputs
You can’t perform that action at this time.
0 commit comments