File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -525,17 +525,20 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterContentIni
525
525
// the user may have assigned some options specifically for the picker
526
526
const pickerOptions = { ...this . pickerOptions } ;
527
527
528
- // Configure picker under the hood
529
- const picker = this . _picker = this . _pickerCtrl . create ( pickerOptions ) ;
530
- picker . addButton ( {
528
+ // Add a cancel and done button by default to the picker
529
+ const defaultButtons = [ {
531
530
text : this . cancelText ,
532
531
role : 'cancel' ,
533
532
handler : ( ) => this . ionCancel . emit ( this )
534
- } ) ;
535
- picker . addButton ( {
533
+ } , {
536
534
text : this . doneText ,
537
535
handler : ( data : any ) => this . value = data ,
538
- } ) ;
536
+ } ] ;
537
+
538
+ pickerOptions . buttons = ( pickerOptions . buttons || [ ] ) . concat ( defaultButtons ) ;
539
+
540
+ // Configure picker under the hood
541
+ const picker = this . _picker = this . _pickerCtrl . create ( pickerOptions ) ;
539
542
540
543
picker . ionChange . subscribe ( ( ) => {
541
544
this . validate ( ) ;
You can’t perform that action at this time.
0 commit comments