In this PR we aims to fix one bug in text input, including:
(1) BUG 1: The way to reproduce the bug is straight-forward: if a user presses keys (e.g., A, B, C) on the keyboard while no editable text is selected, then when he selects an empty editable text and input one letter, (e.g., D), the editable text would become ABCD instead of D. The root cause is that, when the DefaultKeyboardDelegate trying to process the current input (in the method OnGUI()), it will iterate all the input events stored in the queue PointerEventConverter.KeyEvent. Therefore since all the key events would be stored inside the queue even if there is no editable text available to accept them. Once an editable text is activated and trying to accept the current one key event, all the stored (but out-dated) events will be passed to it by mistake.
To fix this issue, we just skip all the key events when no editable text is attached
In this PR we aims to fix one bug in text input, including:
(1) BUG 1: The way to reproduce the bug is straight-forward: if a user presses keys (e.g.,
A
,B
,C
) on the keyboard while no editable text is selected, then when he selects an empty editable text and input one letter, (e.g.,D
), the editable text would becomeABCD
instead ofD
. The root cause is that, when theDefaultKeyboardDelegate
trying to process the current input (in the methodOnGUI()
), it will iterate all the input events stored in the queuePointerEventConverter.KeyEvent
. Therefore since all the key events would be stored inside the queue even if there is no editable text available to accept them. Once an editable text is activated and trying to accept the current one key event, all the stored (but out-dated) events will be passed to it by mistake.To fix this issue, we just skip all the key events when no editable text is attached