@@ -361,9 +361,23 @@ export class Timepicker extends Component<TimepickerOptions> {
361
361
362
362
_setupModal ( ) {
363
363
this . modal = Modal . init ( this . modalEl , {
364
- onOpenStart : this . options . onOpenStart ,
364
+ onOpenStart : ( ) => {
365
+ if ( typeof this . options . onOpenStart === 'function' ) {
366
+ this . options . onOpenStart . call ( this ) ;
367
+ }
368
+ this . modalEl . querySelectorAll ( '.btn' ) . forEach ( ( e : HTMLButtonElement ) => {
369
+ if ( e . style . visibility !== 'hidden' ) e . setAttribute ( 'tabindex' , '0' ) ;
370
+ } ) ;
371
+ } ,
365
372
onOpenEnd : this . options . onOpenEnd ,
366
- onCloseStart : this . options . onCloseStart ,
373
+ onCloseStart : ( ) => {
374
+ if ( typeof this . options . onCloseStart === 'function' ) {
375
+ this . options . onCloseStart . call ( this ) ;
376
+ }
377
+ this . modalEl . querySelectorAll ( '.btn' ) . forEach ( ( e : HTMLButtonElement ) => {
378
+ e . setAttribute ( 'tabindex' , '-1' ) ;
379
+ } ) ;
380
+ } ,
367
381
onCloseEnd : ( ) => {
368
382
if ( typeof this . options . onCloseEnd === 'function' ) {
369
383
this . options . onCloseEnd . call ( this ) ;
@@ -394,10 +408,10 @@ export class Timepicker extends Component<TimepickerOptions> {
394
408
395
409
private _createButton ( text : string , visibility : string ) : HTMLButtonElement {
396
410
const button = document . createElement ( 'button' ) ;
397
- button . classList . add ( 'btn-flat' , 'waves-effect' ) ;
411
+ button . classList . add ( 'btn' , 'btn -flat', 'waves-effect' , 'text ') ;
398
412
button . style . visibility = visibility ;
399
413
button . type = 'button' ;
400
- button . tabIndex = this . options . twelveHour ? 3 : 1 ;
414
+ button . tabIndex = - 1 ;
401
415
button . innerText = text ;
402
416
return button ;
403
417
}
0 commit comments