Search Issue Tracker

Fixed in 2022.2.X

Fixed in 2021.2.X, 2022.1.X

Votes

27

Found in

2021.2.0a21

2021.2.5f1

2022.1

2022.2

Issue ID

1394226

Regression

Yes

Extra OnEnter and OnExit event calls when hovering over UI elements

uGUI

-

Reproduction steps:
1. Open the user's project
2. Enter Play mode
3. Move pointer from outside to panel (Log: Panel on enter)
4. Move pointer from panel to white image

Expected result: Log: Panel on exit; Image on enter
Actual result: Log: Panel on exit; Image on enter; Panel on enter

Reproducible with: 2021.2.0a21, 2021.2.5f1, 2022.1.0b3, 2022.2.0a1
Not reproducible with: 2019.4.34f1, 2020.3.26f1, 2021.2.0a20

  1. Resolution Note (fix version 2022.2):

    Fixed in: 2022.2.0a5

  2. Resolution Note (fix version 2022.1):

    Fixed in: 2022.1.0b12

  3. Resolution Note (fix version 2021.2):

    Fixed in: ​​​​​​​2021.2.17f1

Comments (6)

  1. Simpowitch

    May 20, 2022 10:49

    No, no, no. That is not the Expected behaviour at all! The expected behaviour is NOT that the Panel get's On Exit, this even breaks your own built in Button and Toggle sprite-swap or colour change!

  2. Damien-Mayance

    Apr 28, 2022 14:55

    +1 to previous comments.

    This is completely breaking our project and has huge consequences. There's no way that disabling children is the expected behaviour. Even standard Unity UI components are affected.

    This is not fixed at all.

  3. HarvesteR

    Apr 25, 2022 23:24

    Ran into this one today upgrading from 2019 LTS to 2021 LTS. Seems to be the only major bug, but it broke half of our UI. /facepalm

    Looks like the proper thing we should have done was to make sure only the needed objects have the 'raycast target' flag enabled... you know, that flag that is on by default on EVERY new object, yeah, that one now needs to be off for everything but the objects you are trying to detect input on.

    Not really sure if there is a quick solution to this one, other than to just go through EVERY SINGLE UI CONTROL in a four-year-long project, and make sure there aren't any surplus raycast targets in there.... In cases where the interaction is more complex, like scroll view and dropdowns, I've got no idea how I'm going to fix this... will have to go and revise EACH AND EVERY SINGLE ONE.

    Needless to say, this just added a week of extra work for what could have been a one-day upgrade. I expected this sort of thing but sigh... I guess I need to expect this sort of thing harder.

  4. nsxdavid

    Apr 21, 2022 21:04

    Years and millions of dollars into a project, and this "bug fix" has wrecked our entire UI. It barely functions anymore. Further the version notes on it are written by someone who has no idea how to communicate whatsoever.

  5. Juan_Pixelatto

    Apr 05, 2022 10:46

    So... you forgot to update the behaviour of the DoStateTransition SelectionState value changes in the uGUI Selectable class (UnityEngine.UI assembly) to use the new event properties "reentered" & "fullyExited" in IPointerEnterHandler / IPointerExitHandler callbacks, so now with this fix they won't set to Highlighted in a consistent way

    Right now you are using internally a "hack" (that I had to implement as well in my custom UI components as well as a workaround for this fix) in the Selectable class by tracking with a boolean if the pointer is inside or not.

    This is not fixed yet, is half baked, you must adapt your own code to the API change

  6. StudioEvil

    Jan 12, 2022 13:26

    Hi! There's a typo, it should be:

    Actual result: Log: Panel on exit; Image on enter; Panel on enter
    Expected result: Log: Image on enter

    Thanks!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.