What I’m trying to achieve: present the user with a list of strings to choose from, until they click ok. Then process the selection and give some feedback in an alert. Everything works ok, but the alert just pops up for a brief moment and disappears again without waiting for any user interaction.
What am I doing wrong?
async function info(m) {
let alert = new Alert();
alert.message = m;
let ix = await alert.present();
}
let select = new UITable();
let row = new UITableRow();
let count = 0;
[1,2].forEach(f => {
let row =new UITableRow();
row.dismissOnSelect = false;
row.addText("" + f);
row.onSelect = () => {
count++;
}
select.addRow(row);
})
row = new UITableRow()
let button = row.addButton("ok");
button.dismissOnTap = true;
button.onTap = () => {
info("" + count)
}
select.addRow(row)
await select.present();