Skip to content

Text does not properly sync content when characters are input via numpad (Alt+character code) #30

@stakx

Description

@stakx

Say you have a Text whose DOM element currently contains the text A. Now you enter a B, but not by pressing the B key, but via the numpad: Alt+066. (This input mode could be Windows-specific.) You'll see the text AB in the browser, as you'd expect. When you leave that input, it will revert back to A (i.e. the B gets deleted again, which is an error).

My working theory is that this is because the Text._keyUp event for the last key (6 or Alt) happens before the browser adds the input character in the DOM. Text._keyUp then triggers Text._syncContent which reads A from the DOM node. The B character isn't there yet, so _syncContent misses it and only sees the characters A. When blurring the input node, it'll revert back to the last cached content A.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions