[javascript] bug? app.execDialog() erratic result from dialog.store() for 'edit_text'
Posted: Mon Dec 02, 2024 6:20 pm
When using an edit_text box with PopupEdit: true the information provided to the change event is erratic. Sometimes it provides the most recent change, but sometimes it doesn't update. Sometimes the change event happens twice for one change, sometimes once.
To reproduce:
The text box is already selected, so start typing 12345 then use backspace to delete the numbers one at a time, the console shows:
It's quite erratic. Sometimes it gets the most recent change, sometimes it doesn't.
To reproduce:
Code: Select all
// test of input box
{
const inputTest = {
initialize() {
},
commit() {
},
txB1(dialog) {
console.println( JSON.stringify( dialog.store()));
},
description: {
name: "Edit text box", // Dialog box title
elements:
[{ type: 'edit_text', width: 300, item_id: 'txB1', PopupEdit: true
},
{ type: 'ok'}
]
}
};
app.execDialog(inputTest);
}
Code: Select all
{"txB1":""}
{"txB1":""} // text box actually contains 1
{"txB1":"1"}
{"txB1":"12"} // it caught up to 12
{"txB1":"12"}
{"txB1":"123"}
{"txB1":"123"}
{"txB1":"1234"}
{"txB1":"1234"}
{"txB1":"12345"} // 12345 (it stayed caught up, the event happening twice for each keystroke with the data provided first the value before the keystroke, then after)
{"txB1":"12345"} // 1234 (deleting it's showing the old data and only firing the change event once)
{"txB1":"1234"} // 123
{"txB1":"123"} // 12
{"txB1":"12"} // 1
{"txB1":"1"} // empty