[iOS] When focusing on a NumberBox inside an ItemsRepeater, a crash occurs randomly by high chance. #19682
Labels
difficulty/tbd
Categorizes an issue for which the difficulty level needs to be defined.
kind/bug
Something isn't working
triage/untriaged
Indicates an issue requires triaging or verification
Current behavior
In the open-source Uno Platform-based iOS application currently under development, the application crashes with a very high probability when an
Item
inside anItemsRepeater
within aGrid
contains aNumberBox
.Expected behavior
The application should not crash.
How to reproduce it (as minimally and precisely as possible)
Below is the source code from the commit before replacing
NumberBox
withTextBox
to resolve this issue in the currently developing application:GitHub Repository - Commit 4ea35c6
After building the application, if you add any item in the Manage menu and then navigate to the Items menu, the application crashes when focusing on the
NumberBox
, as shown in the video provided later.There is a very high probability that the crash occurs on the first attempt. If not, switching focus to another element and then back to the
NumberBox
will cause the crash.Workaround
Use
TextBox
Works on UWP/WinUI
Yes
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
NuGet package version(s)
Uno.Sdk
5.6.45
Affected platforms
iOS
IDE
Visual Studio 2022
IDE version
17.13.3
Relevant plugins
None
Anything else we need to know?
Below is the StackTrace that occurs during the crash:
Here is a video demonstrating how to reproduce the issue (recorded on a simulator, but the same happens on a real device):
bandicam.2025-03-15.09-08-48-450.mp4
Before the crash occurs, the following exception always appears:
Possible Cause & Analysis
I believe the crash occurs because when focusing on the
NumberBox
, the entire text gets selected. At this point, iOS assigns a selection highlight UI, which is larger than theNumberBox
itself.Additionally, apart from the crash, when adding an item in the Manage menu and inputting a quantity in the
NumberBox
, if focus is moved to anotherTextBox
, theNumberBox
grows abnormally to the size of iOS’sUITextField
selection highlight UI.Even if this is not the direct cause of the crash, this behavior should be fixed.
The text was updated successfully, but these errors were encountered: