@shepard wrote:
If I create an alert, how can I handle the Save button when the keyboard ‘Go’ button is pressed?
this.alertCtrl.create({ header: 'YourAddress', message: 'What is your address?", inputs: [ { name: 'address', type: 'text', value: this.address, placeholder: 'Address' } ], buttons: [ { text: 'Cancel', handler: data => { console.log('Cancel clicked'); } }, { text: 'Save', handler: data => { console.log('SAVE DATA: ' + data); } } ] }).then(alert => alert.present());
@HostListener('document:keydown.enter', ['$event']) onKeydownHandler(evt: KeyboardEvent) { console.log('enter key hit: How do I handle the alert as if the Save button was pressed? '); }
Posts: 1
Participants: 1