Search Issue Tracker

In Progress

Under Consideration for 2022.3.X

Votes

1

Found in

2022.3.33f1

6000.0.5f1

Issue ID

UUM-73468

Regression

No

ArgumentOutOfRangeException thrown when selecting UI Toolkit dropdown using a gamepad controller

--

-

Steps to reproduce:
1. Open the attached user's project "UITKFaultyControllerSupport.zip"
2. Connect a controller to the PC such as XBOX One
3. Open the SampleScene and enter Play Mode
4. Move the analog stick any direction so it selects the first button in the UI
5. Using the controller, navigate towards the dropdown
6. Once its selected, press X/A on the controller to open it
7. Once opened, press X/A without moving the analog stick or arrows

Expected Result: The existing option is automatically highlighted and selectable so when X/A is pressed this option from the dropdown is selected
Actual Result: An ArgumentOutOfRangeException error is thrown in the console

Reproducible with: 2022.3.33f1, 6000.0.5f1
Could not test on 2021.3.39f1 due to numerous argument exceptions after downgrading

Testing Environment: Windows 11
Not reproducible on: No other environment tested

Notes:
-Exception:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <f22cb97e7aa5412ba04225fa1fc145f2>:0)
UnityEngine.UIElements.GenericDropdownMenu.Apply (UnityEngine.UIElements.KeyboardNavigationOperation op) (at <e3aada69b31740d4a008821e33836432>:0)
UnityEngine.UIElements.GenericDropdownMenu.Apply (UnityEngine.UIElements.KeyboardNavigationOperation op, UnityEngine.UIElements.EventBase sourceEvent) (at <e3aada69b31740d4a008821e33836432>:0)
UnityEngine.UIElements.KeyboardNavigationManipulator.Invoke (UnityEngine.UIElements.KeyboardNavigationOperation operation, UnityEngine.UIElements.EventBase evt) (at <e3aada69b31740d4a008821e33836432>:0)
UnityEngine.UIElements.KeyboardNavigationManipulator.OnNavigationSubmit (UnityEngine.UIElements.NavigationSubmitEvent evt) (at <e3aada69b31740d4a008821e33836432>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <e3aada69b31740d4a008821e33836432>:0)

Comments (1)

  1. kingjames_98

    Jun 11, 2024 20:26

    This happens with keyboard navigation as well.

    I cannot find a way to override this behavior.

    When using a mouse to click, it sends a cancellation, but use any other input contoller to send a submit request provides this same error.

    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <80e08c2cc04049bf931fc9038d04f397>:0)
    UnityEngine.UIElements.GenericDropdownMenu.Apply (UnityEngine.UIElements.KeyboardNavigationOperation op) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.GenericDropdownMenu.Apply (UnityEngine.UIElements.KeyboardNavigationOperation op, UnityEngine.UIElements.EventBase sourceEvent) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.KeyboardNavigationManipulator.Invoke (UnityEngine.UIElements.KeyboardNavigationOperation operation, UnityEngine.UIElements.EventBase evt) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.KeyboardNavigationManipulator.OnNavigationSubmit (UnityEngine.UIElements.NavigationSubmitEvent evt) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.NavigationEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.VisualElement.SendEvent (UnityEngine.UIElements.EventBase e) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.DefaultEventSystem.SendFocusBasedEvent[TArg] (System.Func`2[T,TResult] evtFactory, TArg arg) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.DefaultEventSystem.SendInputEvents () (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.DefaultEventSystem.Update (UnityEngine.UIElements.DefaultEventSystem+UpdateMode updateMode) (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.UIElementsRuntimeUtility.UpdateRuntimePanels () (at <97e48f4f98114f40ad822341cd76c3b8>:0)
    UnityEngine.UIElements.UIElementsRuntimeUtilityNative.UpdateRuntimePanels () (at <f8629cc0540c4e2fab2fe061d58603b5>:0)

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.