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

Partially hidden blocks/images don't scroll into view from the top #3576

Closed
borgar opened this issue Apr 2, 2020 · 2 comments
Closed

Partially hidden blocks/images don't scroll into view from the top #3576

borgar opened this issue Apr 2, 2020 · 2 comments

Comments

@borgar
Copy link

borgar commented Apr 2, 2020

Do you want to request a feature or report a bug?

Bug.

What's the current behavior?

Clicking a partially hidden "block" element scrolls it into view if it at the bottom of the viewport, but not if it is at the top of the viewport.

slate-scroll-issue

The issue is demonstrable with the https://www.slatejs.org/examples/images example if extra text is added to create a scrolling document.

Slate: 0.57.1
Browser: Chrome
OS: Mac

What's the expected behavior?

Block/Image should behave the same way in both up and down directions.

Further notes

I've taken a look at the code and the issue seems to be that the element passed into the scrollIntoView mechanism is a placeholder below the element, and not the element itself. The scroll never happens as the placeholder is "in view" the entire time.

@borgar
Copy link
Author

borgar commented Apr 2, 2020

I would be happy to submit a patch but would I would need guidance where to start. This is being done every keypress so it seems vital that detecting if the scroll-target is within a block and using the block the scroll target is done in the fastest way possible.

@dylans
Copy link
Collaborator

dylans commented Sep 15, 2022

Fixed in #3746

@dylans dylans closed this as completed Sep 15, 2022
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

No branches or pull requests

2 participants