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

Editor viewport is scrolled back to the top when focusing editor for the first time #504

Closed
jbalsas opened this issue Jun 12, 2017 · 2 comments · Fixed by #1923
Closed
Assignees
Labels
browser:edge The issue can only be reproduced in the Edge (edgeHTML engine based) browser. status:confirmed An issue confirmed by the development team. support:3 An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:bug A bug.
Milestone

Comments

@jbalsas
Copy link

jbalsas commented Jun 12, 2017

Are you reporting a feature or a bug?

Bug

Original Report (14827)

Provide detailed reproduction steps (if any)

In Microsoft Edge 14

  1. Go to http://ckeditor.com/demo.
  2. Scroll editor viewport without focusing editor (e.g. using mouse wheel).
  3. Click inside editor content to focus editor.

Optionally, simply do:

  1. Go to http://ckeditor.com/demo
  2. Click on the word oven inside the editor

This can also be reproduced in nightly.ckeditor.com

Expected result

The cursor to be placed where the mouse was pressed (the oven word) and the scroll position of the editor (if any) to be preserved

Actual result

The cursor is placed at the beginning of the content and the scroll position (if any) is lost

Other details

  • Browser: Microsoft Edge 14
  • OS: Windows 10
  • CKEditor version: CKEditor 4.7
  • Installed CKEditor plugins: default ones in CKEditor's demo
@jswiderski jswiderski added the status:confirmed An issue confirmed by the development team. label Jun 13, 2017
@jbalsas
Copy link
Author

jbalsas commented Jun 29, 2017

Hey @jswiderski, could we also label this as a bug, or are there some specific rules for that that this issue doesn't cover?

@f1ames f1ames added browser:edge The issue can only be reproduced in the Edge (edgeHTML engine based) browser. support An issue reported by a commercially licensed client. type:bug A bug. labels Jul 25, 2017
@f1ames f1ames added this to the Backlog milestone Jul 25, 2017
@mlewand mlewand added the target:major Any docs related issue that should be merged into a major branch. label Aug 30, 2017
@Comandeer Comandeer self-assigned this Apr 20, 2018
@Comandeer
Copy link
Member

After some investigation, it seems that the source of issue is located in core/editable.js, in – ironically – function called fixDomhttps://github.com/ckeditor/ckeditor-dev/blob/eb4a25a16a6b0241d655f6a94af5d1568c9f2d9f/core/editable.js#L1428

This function is called on every editor's selectionChange event. This event is also fired on every editor's focus via https://github.com/ckeditor/ckeditor-dev/blob/eb4a25a16a6b0241d655f6a94af5d1568c9f2d9f/core/selection.js#L938-L941

The issue appears because Edge reports the click into editable as range collapsed to the beginning of the editor and fixDom treats this as selection neeeded update, reselecting this range. Chrome also reports such range for the click, however fixDom treats it as correct selection and does not do reselection.

@lslowikowska lslowikowska added support:1 An issue reported by a commercially licensed client. and removed support An issue reported by a commercially licensed client. labels Dec 21, 2018
@f1ames f1ames modified the milestones: Backlog, 4.13.0 Jul 3, 2019
@lslowikowska lslowikowska added support:3 An issue reported by a commercially licensed client. and removed support:1 An issue reported by a commercially licensed client. labels Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:edge The issue can only be reproduced in the Edge (edgeHTML engine based) browser. status:confirmed An issue confirmed by the development team. support:3 An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants