Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Feature Request TextField should select entire text on triple click

Discussion in 'UI Toolkit' started by Xarbrough, Dec 4, 2020.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Currently, when clicking into a TextField for the first time, the entire text is selected. Then clicking again a single time, the cursor is placed in between two characters. Double-clicking will then select the whole word (or if separated by underscores for example).

    I believe this behaviour should be slightly changed to align with other text editors such as Microsoft Word, Notepad, Visual Studio or Rider.

    When triple-clicking, the entire text should be selected.

    Because currently there is no way to select the entire text via the mouse other than clicking out of the text field and back into it, which is unintuitive if other software does this differently.

    It's still arguable what the very first click should do. In other editors, it would directly place the text cursor, but I also see a use-case for selecting the entire text on the first click.

    Thanks for listening to my opinion, but feel free to vote me out. ;)
     
    rigidbuddy and Nexer8 like this.
  2. MatthieuS

    MatthieuS

    Joined:
    Jun 1, 2014
    Posts:
    16
    I would say that giving the option to users when creating TextField. You can specify different click behaviour default (current behaviour), text editor (single: puts cursor, double: selects word, triple: select all) and custom, define own behaviour for single, double and triple :D
     
  3. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    I guess options are always a fair thing, but I want to stress the argument that TextField should follow standards. These might be different for other users, but for me they are pretty clear. Unity may have a greater reach to identify what the most common behavior is.
     
    floriankorsakissok likes this.
  4. floriankorsakissok

    floriankorsakissok

    Joined:
    Jul 19, 2017
    Posts:
    30
    FYI we now have public APIs for customizing this behavior: first and second properties.

    Sorry for necroing this post, but this comes up in search engines.