Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug UI Builder input fields lose focus after typing one character

Discussion in 'UI Toolkit' started by manuelgoellnitz, May 24, 2022.

  1. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    This happens since 2022.1.0 (i think):

    When I work with the UI Builder, added Elements and setting their paramters at some point the input fields of the inspector (like Name etc), lose their focus after typing in one character.
    From this point on, all other input fields have the same bug.
    Closing and reopening the UI builder has no effect.

    It goes back to normal, when I uncheck and recheck "UI Toolkit Live Reload".
     
  2. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    The Bug returns every time I add a new visual element to the hierarchy.
     
  3. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Same bug here using Unity 2021.1.f1!

    It is my first time trying UI Toolkit, and I'm going crazy because I can't set the name of the elements, I can only set one character per time because the input lose the focus. For me, only the input fields from the "Visual Element" tab are running this issue (name, tooltip and view data key inputs), the other inputs still seem to work.

    Unchecking and rechecking "UI Toolkit Live Reload" or also clicking on "Reset UI Builder Layout" make it to work again, but I just set one or two fields and the bug returns.

    For those who don't know where is the "UI Toolkit Live Reload" and "Reset UI Builder Layout", just right-click on the tab of the "UI Builder" window, it will show some options.

    [Edited] Just to say that I'm enjoying using UI Toolkit anyway.
     
    Last edited: May 25, 2022
  4. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    Uh it gets worse:
    When you edit an input field and want to erase the value by presseing "Backspace" multiple times: The first time the character is deleted, then the focus switches and the second time the entire element gets deleted!
     
  5. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    1,260
    I am experiencing this same issue with UIBuilder and Unity 20221.0.
     
  6. alcheMikey

    alcheMikey

    Joined:
    Feb 18, 2021
    Posts:
    30
    Also experiencing this with 2022.1.2f1
     
  7. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    471
    Hi!
    I tested using 2022.1.2f1 and could not reproduce the issue. Does it occur after a specific action?
    Thanks!
     
  8. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    Drag a new VisualElement in the hierarchy, then try to change it's name, for example.
     
  9. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    471
    Yeah, that works correctly for me. Can you file a bug with a repro project so that we can take a look at it?
     
  10. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    I just update from Unity 2022.1.1 to Unity 2022.1.2f1 and the bug still persist.

    I think this same bug was already reported on this forum.

    From the forum: "This is fixed in 2022.2 and the fix for 2022.1 and 2021.3 are on the way."

    The issue tracker:
    https://issuetracker.unity3d.com/is...builders-inspector-loses-focus-after-an-input

    PS: We can rename a Visual Element by double-clicking on it in the Hierarchy panel instead of using the Inspector, of course, to set Text labels it will still be a problem, but most of the time in my case, I just want to rename the elements for organization porpoises.
     
    manuelgoellnitz likes this.
  11. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    471
    Thanks for the bug link!
    I checked it up quickly and it seems the backport is underway, so it should be available soon in 2022.1.

    Hopefully, it should fix the issues you are having.
     
  12. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    I think it is fixed in 2022.1.3
     
  13. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    444
    Can you confirm?

    I don't see it in the changelog. Which begs the question of what other fixes have been done that we're not aware of... :confused:
     
  14. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    Now it happened again, so unfortunatelly not fixed :(
     
    Last edited: Jun 3, 2022
    KamilCSPS likes this.
  15. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,679
    Occurs to me in 2022.1.2f on two different computers...
    Any further system-specific information we could provide to help narrow the cause down?
     
  16. ChGuidi

    ChGuidi

    Joined:
    Dec 28, 2021
    Posts:
    111
    I'm on 2022.1.5 and it still occurs. So it's not backported yet :)
     
  17. Randolphjand

    Randolphjand

    Joined:
    Sep 23, 2017
    Posts:
    28
    It happens to me no matter what version of Unity I am using. Has been happening since the first time I tried it. Sometimes I can enter the text normally for one field and then very next field it happens on.
     
    ChGuidi likes this.
  18. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    2022.1.6 still has that bug.

    Please backport it!
    It is so frustrating to work with the UIBuilder with it.
     
    Thimo_ and DragonCoder like this.
  19. Thimo_

    Thimo_

    Joined:
    Aug 26, 2019
    Posts:
    59
    I just upgraded to 2022.1.6 and got this issue myself too. Very very frustrating
     
  20. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    The Fix is in the Release notes of 2022.1.7.
    Fingers crossed!
     
  21. Thimo_

    Thimo_

    Joined:
    Aug 26, 2019
    Posts:
    59
    So far I didn't have the issue yet so that seems promising
     
    ChGuidi and DragonCoder like this.
  22. ChGuidi

    ChGuidi

    Joined:
    Dec 28, 2021
    Posts:
    111
    yes same here :D
     
    Thimo_ likes this.
  23. PhilipCastiglione

    PhilipCastiglione

    Joined:
    Feb 12, 2021
    Posts:
    1
    I am still having this problem in 2022.3.11f1. Specifically, editing any serialized field in the inspector on a script that I have written will defocus as soon as some kind of validation completes. Usually that's after typing one character, or two very fast.

    Edit to add:
    Enabling m_InspectorUseIMGUIDefaultInspector has stopped the problem for now.
     
    Last edited: Nov 19, 2023
  24. AbandonedCrypt

    AbandonedCrypt

    Joined:
    Apr 13, 2019
    Posts:
    73
    I am also experiencing this bug in a custom editor when using an
    IntegerField
    inside a
    ScrollView
    .

    This is a major setback to the development process.

    Update: // after a patch upgrade to the most current 2022 LTS version, this is fixed
     
    Last edited: Dec 1, 2023