Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpage scrolls when view's DomConverter focuses an element #4068

Closed
oleq opened this issue May 11, 2017 · 4 comments · Fixed by ckeditor/ckeditor5-engine#952
Closed

Webpage scrolls when view's DomConverter focuses an element #4068

oleq opened this issue May 11, 2017 · 4 comments · Fixed by ckeditor/ckeditor5-engine#952
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@oleq
Copy link
Member

oleq commented May 11, 2017

It's a WebKit-specific behavior that makes the web page scroll to the beginning when editing view is focused. I see no other solution than post-focus window.scrollTo to fix the position of the scrollbar.

Note that Image text alternative balloon also suffers because of this.

A follow-up of https://github.com/ckeditor/ckeditor5-link/issues/100.

@oleq oleq self-assigned this May 11, 2017
oleq referenced this issue in ckeditor/ckeditor5-engine May 11, 2017
@oskarwrobel
Copy link
Contributor

This fix should take into consideration not only window scroll but also editable scroll.

may-11-2017 17-30-12

@oleq
Copy link
Member Author

oleq commented May 11, 2017

@oskarwrobel Do you think that moving to previously cached scrollTop and scrollLeft of the element here would resolve it completely?

@oskarwrobel
Copy link
Contributor

I'm afraid not. But restoring scroll only on window object doesn't fix it completely. We should create a manual test with few nested scrolled containers and check.

oleq referenced this issue in ckeditor/ckeditor5-engine May 11, 2017
@oleq
Copy link
Member Author

oleq commented May 11, 2017

@oskarwrobel I extended the fix and it looks like it also works for editables with overflow:scroll.

kapture 2017-05-11 at 18 02 01

@oleq oleq changed the title Webpage scrolls when view's DomConverter focuses an element in WebKit Webpage scrolls when view's DomConverter focuses an element May 12, 2017
Reinmar referenced this issue in ckeditor/ckeditor5-engine May 12, 2017
Fix: `DomConverter` should actively prevent unwanted scrolling on focus. Closes #951. Closes #707. Closes #706.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 11 milestone Oct 9, 2019
@mlewand mlewand added module:view type:bug This issue reports a buggy (incorrect) behavior. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants