I use an Alert to modify some text.
How is possible to add the clearInput
feature or automatically select all text when user open the alert?
private editNote(food: Food) {
let prompt = Alert.create({
title: 'Modify food',
inputs: [{
name: 'name',
value: food.nome // HOW TO MAKE THIS TEXT AUTOMATICALLY SELECTED OR ADD clearInput FEATURE
}],
buttons: [{
text: 'Save',
handler: data => {
let index = this.listaSpesa.indexOf(food);
if (index > -1) {
let editFood = new Food(food.id, food.id_lista, data.name, food.position);
this.storageService.updateAlimento(editFood);
this.listaSpesa[index] = editFood;
Toast.show('Done.', '3000', 'center').subscribe(toast => {});
}
}
},
{
text: 'Cancel',
}],
enableBackdropDismiss: false
});
this.nav.present(prompt);
}