XR Input Module PointerID out of bounds

Hello,

I’m developing a VR game using XR Interaction Toolkit and needed to implement a worldspace UI using UI Toolkit. After some research and experimentation, I managed to create a solution for my project. However, I’m encountering an issue when using a TextField in XR alongside the Oculus Keyboard. Specifically, I get errors related to the pointer ID being out of bounds in the PanelRaycaster when clicking multiple times on the TextField.

Here’s the error I’m encountering:

2024/08/16 07:31:12.906 17039 17060 Error Unity IndexOutOfRangeException: Index was outside the bounds of the array.
2024/08/16 07:31:12.906 17039 17060 Error Unity   at UnityEngine.UIElements.PointerDispatchState.GetCapturingElement (System.Int32 pointerId) [0x00000] in <00000000000000000000000000000000>:0 
2024/08/16 07:31:12.906 17039 17060 Error Unity   at UnityEngine.UIElements.PointerCaptureHelper.GetCapturingElement (UnityEngine.UIElements.IPanel panel, System.Int32 pointerId) [0x0001a] in \home\bokken\build\output\unity\unity\Modules\UIElements\Core\PointerCaptureController.cs:57 
2024/08/16 07:31:12.906 17039 17060 Error Unity   at UnityEngine.UIElements.PanelRaycaster.Raycast (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] resultAppendList) [0x000df] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\EventSystem\UIElements\PanelRaycaster.cs:95 
2024/08/16 07:31:12.906 17039 17060 Error Unity   at UnityEngine.EventSystems.EventSystem.RaycastAll (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] raycastResults) [0x00042] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\EventSystem\EventSystem.cs:276 
2024/08/16 07:31:12.906 17039 17060 Error Unity   at UnityEngine.XR.Interaction.Toolkit.UI.UII

If anyone with experience with the EventSystem and PointerData could offer some insights or help in finding a solution, I would greatly appreciate it.

The script I made for Worldspace UI
WorldSpaceUIDocument.cs (2.5 KB)

Any update? It is a very annoying error.