-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Writing flow: restore click redirect between blocks #32164
Conversation
@@ -157,6 +158,7 @@ export function useInnerBlocksProps( props = {}, options = {} ) { | |||
|
|||
const ref = useMergeRefs( [ | |||
props.ref, | |||
useInBetweenClickRedirect(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the block list root should just be reusing the inner blocks hooks. See #29895.
"<!-- wp:table --> | ||
<figure class=\\"wp-block-table\\"><table><tbody><tr><td></td><td>2</td></tr><tr><td></td><td></td></tr></tbody></table></figure> | ||
<!-- /wp:table -->" | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snapshot has just been moved to alphabetical order automatically.
Size Change: +372 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
a31e54f
to
1d5c8c9
Compare
I tested with gutenberg.run and it does indeed resolve the linked issues. |
1d5c8c9
to
1cee48a
Compare
Great work on this! The latest commits have enhanced the selection experience. I still found a couple little oddities but they don't look like blockers to me as they are in trunk as well. Highlighting them for the record and in case a solution occurs. block-selection.mp4Okay, that first one isn't exactly in trunk but I think it would be if a horizontally between click actually attempted to select a child. It so happens I'd retested this a few days ago when I got curious if it'd done anything for horizontal blocks and had noticed some issues, but your commits fixed them before I got around to highlighting them. |
3563080
to
ed43e6f
Compare
@stokesman There was a bug with inner blocks. Could you retest? :) |
I retested but couldn't spot any differences. I don't know if ed43e6f was meant to address it but regarding that "outside clicks select last-child" I have a few more details that might help (but it is present in trunk so I don't think it needs fixed here).
horz-block-outside-clicks.mp4 |
ed4c1c0
to
95575c8
Compare
@stokesman I'm not sure if I can reproduce it consistently and I'm not sure if it's related to this PR. Does it happen in trunk too? Anyway, I adjusted the PR to only look in the orientation of the block list, which should help reduce issues. Tests are passing now and it seems to work well. |
Yes, anything I last flagged was also present in trunk*. I've retested this and it works very well. LGTM as in Lets Get This Merged! *Having retested, I found the odd behavior I flagged earlier about clicks outside (Buttons or Navigation) block is still present in both trunk and this branch but it has changed the same way in both (now it selects the first-child) and that seems to further indicate it is unrelated to any changes in this branch. |
@stokesman Maybe the behaviour you're experiencing in related to #34009? |
309a97f
to
8d8c75e
Compare
8d8c75e
to
b794c26
Compare
Seems to be it. |
Hi What are the next steps in this PR? |
Simplified this in #42475. |
Description
Fixes #32129.
Fixes #28682.
Restored a feature removed in #27860 where a click between two block would set focus/caret to the closest point.
I rewrote the feature to be its own hook, independent of the insertion point.
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).