Search Issue Tracker

By Design

Votes

9

Found in

2021.2.17f1

2021.3

2021.3.0f1

2022.1

2022.2

Issue ID

1420134

Regression

Yes

Button does not retain highlight state upon mouse entering raycast-enabled child image.

uGUI

-

Reproduction steps:
1. Open the attached project
2. Select the "Image" GameObject in the Hierarchy window (SampleScene > Canvas > Button > Image)
3. Enable the "Raycast Target" option under Image Component in the Inspector window
4. Hover the cursor over the red square of the button in the Game View
5. Observe button behavior

Expected result: button should be highlighted when the cursor is over the "Image" GameObject, which has the "Raycast Target" option enabled
Actual result: button is not highlighted

Reproducible with: 2021.2.17f1, 2021.2.19f1, 2021.3.1f1, 2022.1.0f1, 2022.2.0a11
Not reproducible with: 2019.4.38f1, 2020.3.33f1, 2021.2.16f1

  1. Resolution Note:

    I believe this by design now. We meant to fix an issue where should not highlight the parent - 1067993.
    I would suggest the user to use fullyExisted flag to determine whether to highlight the parent. I'll see if Roxanne has anything to add.

Comments (3)

  1. karliss_coldwild

    May 10, 2022 10:27

    >I would suggest the user to use fullyExisted flag to determine whether to highlight the parent.

    The code which is doing the hilighting and doesn't handle the new fullyExited flag is written by Unity and part of builtin Unity packages.

    > I believe this by design now.

    If this is fully by design It shouldn' break buttons created using "UI/Button - Textmesh Pro". In the complete default setup it's somewhat working but if you increase "left" value for the text field so that it's slightly smaller than whole button then entering button from right side so that it hits child text first works. But if you enter the button from left side so that hits parent element first then during parent->child transition button will unhilight. This doesn't require some special button with "incorrectly" setup image hierarchy, this can be repeated with minor style changes to default button created by Unity and no changes to "raycast target" settings.

  2. karliss_coldwild

    May 10, 2022 09:38

    https://issuetracker.unity3d.com/issues/ipointerenterhandler-dot-onpointerenter-is-not-called-by-the-unity-engine-when-it-should-be-regression-bug suggested that exit event with "fullyExited=false" should later be followed by one more with "fullyExited=true" but that seems to be based on assumption that child is strictly inside parent and before fullyExited=true there will always be enter with "reentered=true". This is not true if child is close to edge and mouse moving sufficiently fast there is no event for reentering from child to parent and no exit event with "fullyExited=true".

  3. Eloujah

    Apr 25, 2022 17:31

    Hi,

    How can we get the old behaviour before the issue 1067993 has been fixed?
    What does "I would suggest the user to use fullyExisted flag to determine whether to highlight the parent." means? What is the "fullyExisted" flag?

    Thank you

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.