Search Unity

Feature Request Tooltips for disabled elements

Discussion in 'UI Toolkit' started by Stardog, Jan 23, 2020.

  1. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    Tooltips for disabled elements would be useful to explain why a button is disabled.
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    We're aware of this limitation and will eventually fix it. In the meantime, one workaround is to put your disabled element inside a plain VisualElement and give this parent the tooltip.
     
    Stardog likes this.
  3. tankorsmash

    tankorsmash

    Joined:
    Jul 20, 2019
    Posts:
    7
    Has there been an update to this? It doesn't seem natively possible in 1.0 preview 14 without the visual element to cover it.
     
  4. uBenoitA

    uBenoitA

    Unity Technologies

    Joined:
    Apr 15, 2020
    Posts:
    220
    We have added a number of functionalities for disabled elements recently, to make UI Toolkit closer to IMGUI in terms of features. Tooltips are now displayed by default on disabled elements starting from the Unity 2021.2 built-in UI Toolkit. These changes are not going to be included in the package however.
     
    mariandev, tankorsmash and Nexer8 like this.
  5. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Is this change for editor only? If, yes how would you implement tooltips on a disabled element in runtime, taking in consideration that disabled elements do not receive all events?

    (related question https://forum.unity.com/threads/disabled-visualelement-events.1134517/)
     
  6. uBenoitA

    uBenoitA

    Unity Technologies

    Joined:
    Apr 15, 2020
    Posts:
    220
    Yes, this is for editor only. Unfortunately the support for controlling events on disabled elements is still internal only at this point, as we are still studying a few designs, so you wouldn't be able to implement it yourself for runtime I'm afraid.