viewportChange event doesn't fire if cursor isn't on first or last line #2955

Closed
opened 2014-11-30 00:22:25 +01:00 by marijnh · 1 comment
marijnh commented 2014-11-30 00:22:25 +01:00 (Migrated from gitlab.com)

If the cursor is not on the first or last line, adding or removing a line will not cause the viewportChange event to fire, even though the value returned by getViewport() has changed.

For example, in the Autoresize Demo, positioning the cursor on the last line and pressing enter twice and delete once triggers three viewportChange events. After moving to the second-to-last line, pressing enter does not trigger any viewport events.

screen shot 2014-11-29 at 6 16 17 pm

Video: http://files.ryanberdeen.com/Ykzd, JSFiddle: http://jsfiddle.net/also/93n7q8rw/2/embedded/result/

If the cursor is not on the first or last line, adding or removing a line will not cause the `viewportChange` event to fire, even though the value returned by `getViewport()` has changed. For example, in the Autoresize Demo, positioning the cursor on the last line and pressing <kbd>enter</kbd> twice and <kbd>delete</kbd> once triggers three `viewportChange` events. After moving to the second-to-last line, pressing enter does not trigger any viewport events. ![screen shot 2014-11-29 at 6 16 17 pm](https://cloud.githubusercontent.com/assets/15624/5236127/e3461ace-77f3-11e4-9fbd-d26224e31a53.png) Video: http://files.ryanberdeen.com/Ykzd, JSFiddle: http://jsfiddle.net/also/93n7q8rw/2/embedded/result/
marijnh (Migrated from gitlab.com) closed this issue 2014-12-02 11:26:33 +01:00
marijnh commented 2014-12-02 11:26:54 +01:00 (Migrated from gitlab.com)

Good point. Attached patch fixes this.

Good point. Attached patch fixes this.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#2955
No description provided.