Search Issue Tracker

Fixed in 2019.3

Fixed in 2019.1, 2019.2

Votes

28

Found in

2019.1.0a5

2019.1.0f2

Issue ID

1146883

Regression

Yes

Re-enabling game object with "Toggle group" loses information about previously checked toggle

uGUI

-

Steps to reproduce:
1. Open attached project "Test.zip"
2. Go into play mode
3. There are 3 toggles at the top, select a red one (row of red toggles should appear on the left side)
4. Check the first toggle on the left side row (You can check any toggle, but remember your choice)
5. Press green toggle (from 3 toggles at the top)
6. Press red toggle again (from 3 toggles at the top)
-The first toggle is not selected anymore from the left row, instead, another toggle is checked randomly. (Attached a video)

Explanation: Toggles at the top disable/enable "Toggle group" (only a single game object with toggle group is active at a time)

Expected result: After re-enabling element with "Toggle group" it shouldn't uncheck previously checked toggle
Actual result: Re-enabling game object with "Toggle group" loses information about previously checked toggle and instead checks random toggle in the group

Note: Sometimes it takes a couple of tries to reproduce the bug (repeat steps from 3rd step)

Reproduced on: 2019.1.0a5, 2019.1.0a6, 2019.1.0a11, 2019.1.0f2, 2019.2.0a1, 2019.2.0a10
Doesn't reproduce on: 2017.4.0f1, 2018.3.13f1, 2019.1.0a1, 2019.1.0a3, 2019.1.0a4
Regressed in: 2019.1.0a5

  1. Response avatar

    Resolution Note (fix version 2019.3):

    By default, ToggleGroup is coded to activate/deactivate the container for all associated Toggle elements. When the container is deactivated, all contained Toggles will get their OnDisable called. This will cause the Toggle to unregister itself from the ToggleGroup.

    When a Toggle calls UnregisterToggle() on it's ToggleGroup, it is removed from the ToggleGroup's internal list.

    Previously, any time UnregisterToggle() was called on a ToggleGroup that is set to disallow an off state, the group will then scan its list for at least one checked Toggle. Because the checked toggle is ultimately removed from the list before the list is totally emptied, the group will attempt to fix itself and set the first Toggle in the list to be On. This creates unpredictable behavior, both because the order of the list is non-deterministic, and because the first list element is rarely the value that should be set to On.

    This PR moves the logic for ensuring that one Toggle is marked On to a new function. The only times that this function actually needs to be invoked are:

    a) when the ToggleGroup gets its Start() method invoked. This will ensure that a ToggleGroup created in the Editor has a valid state when loaded.
    b) when a Toggle is deleted from the ToggleGroup. If the checked toggle is deleted programmatically or via the scene hierarchy, the list must choose a new one.

    New Toggles that are added programmatically will fix the state of the ToggleGroup as happened previously.

Comments (73)

  1. E7e1f47ca17194d9d884b8c3dc614f12?d=mm

    johnmeller12

    Sep 14, 2019 09:27

    This really fixed my problem. Works like a charms

    Thanks

    https://messagingappforandroid.home.blog/

  2. E7e1f47ca17194d9d884b8c3dc614f12?d=mm

    johnmeller12

    Sep 14, 2019 09:20

    I was facing the same issue since last few days. This helped me solve it. Thanks

    http://messagingappsforandroid.simplesite.com/

  3. 2b5e8a3c73fec544a52f03dcd7b0bbaf?d=mm

    Rahulkothey

    Sep 11, 2019 11:17

    192.168.l.l is an IP address utilized by numerous switches and modems as the default portal. 192.168.1.1 location can be utilized by the clients to pick up the switch administrator get to and arrange their switches and systems. http://itechinspector.com/192-168-1-1.html

  4. Ff9e8beae8494bc09f856ed7ebd90202?d=mm

    advitsharma

    Sep 11, 2019 07:43

    I was looking for the same solution.
    Thanks for sharing this great info with Us.

    https://alcody.com/best-male-enhancement-pills/

  5. 4f3da6edad32b5feda6f8237e6adae69?d=mm

    adityaadit0019

    Sep 10, 2019 16:40

    192.168.1.1 router admin login. The default username and password list for all routers. How to find your router's username, password, and IP address easily.
    https://www.19216811rounterlogin.com/

  6. Ae565a31670a9d8735d2fb2649ac62d3?d=mm

    veer01

    Sep 10, 2019 08:38

    I was looking for a solution for this trouble a long time.
    - <a href="https://themawto.com"> TheMawto </a> .

  7. Ed3270843f3a3ec9797dc81018aa0c35?d=mm

    richardgroover192

    Sep 10, 2019 08:15

    I was looking solution for this trouble a long time
    https://1921681001.net/

  8. Faba09fbcc50326e25b6184d13991d74?d=mm

    terkom

    Sep 03, 2019 09:57

    Great Article it its really informative and when a router is connected to a modem, all of the computers that are connected to the router, and subsequently accessing the Internet through the modem, are part of the network.
    https://19216811-login.info

  9. 6f697fd529c0cd5161b8e804659dcb98?d=mm

    theshoppermom

    Aug 29, 2019 12:59

    Great Article it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot. https://www.theshoppermom.com

  10. E7c316c69ba98a0b86e15dd03658a508?d=mm

    twild19

    Aug 28, 2019 07:48

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.