Notes: Forward mouse wheel events from floating sidebar to editor canvas#73655
Notes: Forward mouse wheel events from floating sidebar to editor canvas#73655
Conversation
|
Size Change: +79 B (0%) Total Size: 2.57 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| // Apply the scroll effect to the sidebar ref. | ||
| useEffect( () => { | ||
| if ( commentSidebarRef?.current ) { | ||
| return scrollToCanvasEffect( commentSidebarRef.current ); |
There was a problem hiding this comment.
This isn't how ref effects work; you should either attach events inside the effect or pass scrollToCanvasEffect as ref to the element.
There was a problem hiding this comment.
I've made some changes based on your feedback in 71e0695. Is this approach correct?
|
Flaky tests detected in 71e0695. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19819225803
|
Trying one approach to solving #73653.
What?
This PR propagates mouse scroll events to the editor canvas, making it easier to bring overflowing floating note content into view.
Why?
Floating notes are auto-aligned to the block position, and even if they overflow, the note sidebar is not scrollable, so you have to move your mouse cursor to the editor canvas and scroll there, which is a bit tedious.
Testing Instructions
Screencast
a3d14bd058fa3048c56c6845ab3e95ee.mp4