Type Editor / @type-editor/dom-change-util / parse-change/looks-like-enter-key
parse-change/looks-like-enter-key
Functions
| Function | Description |
|---|---|
Checks if the change looks like the effect of pressing the Enter key. Sometimes it's better to handle block creation through the Enter key handler rather than as a DOM change. This function detects those cases using two different strategies: iOS Enter Detection: iOS specifically tracks Enter key presses. If a recent Enter was detected and either the change is not inline or block elements (DIV/P) were added, treat it as an Enter key press. Generic Block Enter Detection: For other platforms, detect Enter by checking if:
If detected, the change is delegated to the handleKeyDown plugin system with an Enter key event. |