You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In (all) text editors, if you move the caret with arrow keys, or edit text (e.g., press enter) such that the caret goes off screen, the viewport is scrolled to keep the caret in view.
Due to the overriding of Enter and Tab behaviors combined with event.PreventDefault(), pressing enter or tab while caret is offscreen does not bring the caret into view.
The text was updated successfully, but these errors were encountered:
This seems to be a pretty common problem in browsers when trying to override some key behavior and/or move caret position programmatically.
Some solutions seem to be to emit a keyboard event, or arrange for event.PreventDefault() to not happen (this is how the Go Playground avoid this problem on Return, but it has the same issue when pressing Tab; it's just less noticeable since Tab doesn't move the caret offscreen vertically).
dmitshur
changed the title
GopherJS Playground: Minor issue, caret is not kept in view when pressing Enter, Tab.
Playground: Minor issue, caret is not kept in view when pressing Enter, Tab.
Jun 1, 2015
This is an extremely minor issue.
In (all) text editors, if you move the caret with arrow keys, or edit text (e.g., press enter) such that the caret goes off screen, the viewport is scrolled to keep the caret in view.
Due to the overriding of Enter and Tab behaviors combined with
event.PreventDefault()
, pressing enter or tab while caret is offscreen does not bring the caret into view.The text was updated successfully, but these errors were encountered: