• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Feature Request: A way for edit-field text to not be selected by default.

LEGEND ,
Jun 16, 2010 Jun 16, 2010

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

TOPICS
SDK

Views

873

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 18, 2010 Jun 18, 2010

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 18, 2010 Jun 18, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 18, 2010 Jun 18, 2010

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 19, 2010 Jun 19, 2010

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 19, 2010 Jun 19, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 19, 2010 Jun 19, 2010

Copy link to clipboard

Copied

LATEST

Oh well...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines