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
Experiment: Show in View behavior #53729
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/block-supports/behaviors.php ❔ lib/theme.json |
Size Change: +548 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
Closing this PR as it was just meant to be an experiment. It can always be reopened/reused in the future. |
What?
This is an experiment to add a new behavior to blocks to show them only when they are in the viewport.
Why?
It would be a nice user experience that could be easily enabled by the users.
How?
This is a video explaining the PR and how it works right now:
https://www.loom.com/share/d915946066814f7da5e9a4c4dd944812?sid=d10c7f9a-652b-4416-9b34-04dc0ad4f398
Creating a Show In View behavior that, when enabled, adds some directives using the Interactivity API. In JavaScript, it uses the
IntersectionObserver
to detect once an element is in the viewport.To Do
This is a list of things that are not implemented yet: