Search Unity

Moving VisualElement results in lost Hover state

Discussion in 'UI Toolkit' started by Timboc, May 18, 2021.

  1. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    Trying to implement runtime tooltips (2020.3.4f1 + UITK 1.0 preview14, multiple platforms). I've run into an issue whereby if I set an element's position (either .transform.position or e.g. .style.left), the rest of the UI immediately loses the hover pseudo-state that it had. If I delay the movement, the hover state persists until the move is executed.

    I guess an element move is somehow causing a canvas redraw without then re-applying the hover state? This prevents getting runtime tooltips up and running and is a real nuisance for us.

    I'm happy to file a bug but as this could manifest itself in many different ways I wanted to check if this issue is already known?
    For various reasons we are keen to stay on 2020 lts for the meantime - so if it's something fixed in 2021 we'd super appreciate a backport.

    Many thanks for the team's work as always.
     
  2. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    This is a known issue, currently not fixed yet in 2021.2 alpha but surely will be available through the package for 2020 at some point. I'll try to raise priority internally.
     
    BetaDeltic likes this.
  3. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    You're a super star, many thanks