Unity Issue Tracker - Buttons don't get focused when they are custom-made by the user
Closed
UUM-22841
Buttons don't get focused when they are custom-made by the user
Unity: UI Toolkit Controls
UITK
Won't Fix
2023.2.X
2023.1.X
2023.1.0a1 onwards
This will be fixed with the new UXML Serialization feature in versions 2023.2 and after as they now detect the actual default value instead of relying on the UxmlTraits.
Fix in 2023.2 won't be backported as it's part of a feature work. A workaround is to override the default value of the attribute in the UxmlTraits of the element (see examples like PackageList, SelectableLabel and SearchFieldBase).
Reproduction steps:
1. Open the attached project “FocusRepro”
2. Open Window → App UI → StoryBook window
3. In the StoryBook window click on Kit → Main
4. Press the “Tab” button multiple times
Expected result: The focus cycles through all buttons
Actual result: The focus skips custom-made buttons
Reproducible with: 2022.2.0a18, 2023.1.0a1, 2023.1.0a25
Not reproducible with: 2021.3.16f1, 2022.1.24f1, 2022.2.2f1
Couldn’t test with:2020.3.44f1 - This version doesn’t have a built-in UI Toolkit
2022.2.0a1 - 2022.2.0a8 - Third-party package errors
Reproducible on: macOS 13.1 (Intel)
Prioritise and Follow this issue
Have a workaround or additional info about this issue?