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

Blocks: Scroll the page to the inserted block #752

Merged
merged 1 commit into from
May 10, 2017

Conversation

youknowriad
Copy link
Contributor

closes #621

Try inserting an image, a text, a button, a separator.
The editor should scroll to the inserted block properly.

@youknowriad youknowriad added this to the May Week 2 milestone May 10, 2017
@youknowriad youknowriad self-assigned this May 10, 2017
@youknowriad youknowriad requested review from jasmussen and aduth May 10, 2017 11:18
@jasmussen
Copy link
Contributor

Works for me! Nice and simple! 👍 👍

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From @iseulde's comment at #565 (comment), I thought we might need to try to control TinyMCE's behavior to ensure consistency. But I was finding that this event wasn't being fired. Instead, I think it's just that TinyMCE is also calling focus to the newly initialized content body here:

https://github.com/tinymce/tinymce/blob/8695816/src/core/src/main/js/init/InitContentBody.js#L140

There doesn't seem to be a way to control this and, honestly, I don't think it's going to be terribly disruptive since it seems like it's the Editable and its block wrapper fighting for focus. In either case the user will likely end up where they'd like.

My only concern was whether scroll-by-focus was a browser-specific implementation, but in my brief testing, this appears to behave consistently across Chrome, Safari, Firefox.

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.

Inserting a new block should scroll to that block
3 participants