Frontmatter
| id | 1729 |
| title | form.field.Text: it is not possible to use arrow keys (left & right) to change the cursor position |
| state | Closed |
| labels | bug |
| assignees | tobiu |
| createdAt | Apr 6, 2021, 8:18 PM |
| updatedAt | Apr 6, 2021, 8:22 PM |
| githubUrl | https://github.com/neomjs/neo/issues/1729 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 6, 2021, 8:22 PM |
this is related to main.DomEvents:
/** * * @param {Object} event */ onKeyDown(event) { this.sendMessageToApp(this.getKeyboardEventData(event)); if (['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp'].includes(event.key)) { event.preventDefault(); } }Selection models have pretty bad side effects in case the keydown event is not disabled. The Browser tries to scroll DOM nodes into the visible area in case they receive focus, which is colliding with the internal scroll logic.
If I remember it right, the helix had problems as well.
However, input nodes need the event, otherwise you can not navigate.
I am not 100% sure if we should enable or disable specific targets.
For now, I will enable the keypress default event handling for input fields only. Please add a comment in case we need other targets as well or switch the behavior.