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

Refactor Selection#scrollIntoView() #3717

Merged
merged 1 commit into from
Jan 14, 2023
Merged

Refactor Selection#scrollIntoView() #3717

merged 1 commit into from
Jan 14, 2023

Conversation

luin
Copy link
Member

@luin luin commented Jan 4, 2023

Breaking Change: This PR moves scrollIntoView from selection to quill to make it easier to be overridden. The only reason scrollIntoView was in selection seems to be the usage of lastRange but in quill we already use this.selection.lastRange. On second thought I think semantically it makes sense to keep it in the selection module.

Also not sure why if (first == null || last == null) return; is needed so this PR removes it.

@luin luin force-pushed the zh-demo-selection branch 2 times, most recently from 2ea6fdc to b108687 Compare January 9, 2023 03:41
@luin luin changed the title Move scrollIntoView to Quill Only scroll editor upon focus if element fits in viewport Jan 9, 2023
@luin luin changed the title Only scroll editor upon focus if element fits in viewport Refactor Selection#scrollIntoView() Jan 9, 2023
@luin luin marked this pull request as ready for review January 9, 2023 04:57
@jhchen jhchen merged commit d2f689f into develop Jan 14, 2023
@jhchen jhchen deleted the zh-demo-selection branch January 14, 2023 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants