Repository navigation
Conversation
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
There several accidental zoom in/zoom out screen-20261011-164227.mp4 |
This comment was marked as outdated.
This comment was marked as outdated.
| persistFontSize(); | ||
| } | ||
|
|
||
| const target = view.contentDOM; |
There was a problem hiding this comment.
Touch events keep targeting the element where each finger first landed, even after that element is removed from the DOM. Since move/end/cancel are only listened for on contentDOM, the gesture can get stuck:
- Two fingers start on lines in the lower part of the editor; spread to ~2x.
- The preview font change +
requestMeasure()makes CM recompute a smaller viewport (visible area + ~500px margin), and the.cm-lineunder a finger is unmounted. - That finger's
touchmove/touchendnow dispatch to a detached node and never reachcontentDOM.
Result: gesture.pinching stays true, the inline preview is never cleared or persisted, and every subsequent two-finger touchstart bails on if (gesture.pinching ...) — pinch is dead until the editor state is swapped.
Suggest attaching the move/end/cancel listeners to window/document (capture) when a pinch starts and removing them in endPinch/destroy.
|
Also isn't the line number area and editor area pinch-to-zoom at same time for better and smooth feel? as currently line number area adjusted itself after leaving zoom. Also in some cases some accidental scrolls maybe using three finger/two finger etc does nothing but normally in acode those just scrolls so removing that will be a bit weird(if there is no valid reason) |
Description
Adds pinch-to-zoom support to the editor to make editing more convenient on mobile devices.
Users can adjust the editor's font size using a two-finger pinch gesture, improving readability and usability on smaller screens.
Changes Made
Testing
Related Issue
Closes #2426