Scripts run when "Enter" is pressed in edittext
Scripts run when "Enter" is pressed in edittext
I've noticed that scripts will run when a user presses the enter key after entering text in the edittext box. Is there a way to prevent this from happening?
Scripts run when "Enter" is pressed in edittext
ScriptUI will make a button the default button if it has the text of 'Ok' or the name 'ok'. With a default button in the dialog enter is handled by the default button's onClick callback. Even if the button does not have focus.
To prevent the dialog from closing when the user presses enter just rename or relabel the Ok button.
If you really wanted the button name/text to stay Ok you could add a keyboard event handler to the onClick callback to trap the enter key.
To prevent the dialog from closing when the user presses enter just rename or relabel the Ok button.
If you really wanted the button name/text to stay Ok you could add a keyboard event handler to the onClick callback to trap the enter key.
Scripts run when "Enter" is pressed in edittext
I'll just rename the button since that's all it takes.
Thanks
Thanks