Skip to content

Commit ca3f46c

Browse files
author
Rene Damm
authored
CHANGE: Disabled items can no longer be selected in AdvancedDropdown (#782).
1 parent b58311b commit ca3f46c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPickerDropdown.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ protected override AdvancedDropdownItem BuildCustomSearch(string searchString,
103103

104104
protected override void ItemSelected(AdvancedDropdownItem item)
105105
{
106-
if (!item.enabled)
107-
return;
108-
109106
var path = ((InputControlDropdownItem)item).controlPathWithDevice;
110107
m_OnPickCallback(path);
111108
}

Packages/com.unity.inputsystem/InputSystem/Editor/Internal/AdvancedDropdown/AdvancedDropdownWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,15 +447,15 @@ private void DrawList(AdvancedDropdownItem item)
447447

448448
// Select the element the mouse cursor is over.
449449
// Only do it on mouse move - keyboard controls are allowed to overwrite this until the next time the mouse moves.
450-
if (Event.current.type == EventType.MouseMove || Event.current.type == EventType.MouseDrag)
450+
if ((Event.current.type == EventType.MouseMove || Event.current.type == EventType.MouseDrag) && child.enabled)
451451
{
452452
if (!selected && r.Contains(Event.current.mousePosition))
453453
{
454454
m_State.SetSelectedIndex(item, i);
455455
Event.current.Use();
456456
}
457457
}
458-
if (Event.current.type == EventType.MouseUp && r.Contains(Event.current.mousePosition))
458+
if (Event.current.type == EventType.MouseUp && r.Contains(Event.current.mousePosition) && child.enabled)
459459
{
460460
m_State.SetSelectedIndex(item, i);
461461
var selectedChild = m_State.GetSelectedChild(item);

0 commit comments

Comments
 (0)