Search Issue Tracker
Feature Request
Votes
0
Found in
2022.2.0b12
2022.3.10f1
2023.1.16f1
2023.3.0a9
Issue ID
UUM-52685
Regression
No
Right-mouse click on the Input Field label does not bring up the context menu when using UI Toolkit Custom Element
How to reproduce:
1. Open the attached project "3-UITKRightClickFieldMenu.zip"
2. Open Assets/Scenes/EditorBugs.unity
3. Select "3-UITKRightClickFieldMenu(InPreview)" in the Hierarchy window
4. Right-mouse click on "Float Referencer" in the Inspector window
Expected results: Context menu appears
Actual results: The context menu does not appear
Reproducible with: 2022.3.10f1, 2023.1.16f1, 2022.2.0b12, 2023.3.0a9
Could not test with: 2021.3.31f1 (no GUI Implemented)
Reproducible on: Windows 11 22H2
Not reproducible on: No other environment tested
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
Translation between IMGUI property drawer and custom UITK hierarchy provided in the repro project is not trivial. The Context Menu not showing up is a result of the user's DropdownPropertyField not being recognized by the binding system and thus not generating a Context Menu for its label. There is currently no easy way in UITK to make the label of a user-defined VisualElement inherit from the Context Menu of a parent PropertyField. You can however instantiate a PropertyField in the CreatePropertyGUI method, modify its inner content to reflect you needs, and keep its label as is to get the Context Menu you want.