Copy link to clipboard
Copied
edit_field text is selected by default, which means as soon as the user starts typing, pre-existing content is wiped out - not cool...
Thanks,
Rob
Copy link to clipboard
Copied
I've found a partial workaround to this: Once the dialog is showing, if the you first assign the empty string and then assigned the desired value:
edit_field.value = ""
edit_field.value = desiredValue
then the contents of the field are not left selected. This works when setting the contents from, say, the result of a button push, but I haven't figured out how to initially show the contents unselected.
Copy link to clipboard
Copied
Hi John,
I tried starting an async task to do the assignment after the dialog box displayed but that didn't work for me.
Rob
Copy link to clipboard
Copied
I tried starting an async task to do the assignment after the dialog box displayed but that didn't work for me.
Too bad. It works from a static_text.mouse_down callback in my plugin.
Copy link to clipboard
Copied
I tried starting an async task to do the assignment after the dialog box displayed but that didn't work for me.
I just noticed that forum software seems to have deleted a space in my post. The code fragment should be:
edit_field.value = "<space>"
edit_field.value = desiredValue
Setting the value to the empty string doesn't work for me -- it needs to be a space.
Copy link to clipboard
Copied
Hi John,
Still couldn't get it to work from an async task (with the space). I guess it has to be "synchronous" (like event handler), unless I'm doing something wrong.
Ciao for now,
Rob
Copy link to clipboard
Copied
Oh well...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now