-
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
Details block: remove auto-close behaviour #67766
Conversation
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. |
Size Change: -24 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
This is a bit better in that I can keep it open to drag and drop but if I try to drag and drop when it's closed, I still don't get a lot of clarity: better.details.movTied to that, I noticed I can't drag and drop above the block when it's the first one within the post content block when writing a new page. I couldn't replicate with the Heading block so thought I'd mention it in case it's unique to the Details block: yes.i.can.mov |
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.
The code-wise, this looks good ✅
Technically, you can drag and drop blocks into a closed Details block, but the drop indicator isn't visible.
Screeenshot
CleanShot.2024-12-10.at.11.01.33.mp4
66ede25
to
636374a
Compare
Flaky tests detected in 636374a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12749872443
|
What?
Removes the auto-close behaviour. Currently the details blocks automatically collapses when selection is moved away.
Why?
Fixes #51247.
It makes it impossible to drag blocks into the details block. I also find it quite distracting that the layout shifts when you select the details block. It seems much better to let the user decide when to open and close it.
How?
Remove the condition and instead add local state connected to clicking the summary element.
Testing Instructions
Insert a details block. Drag blocks into it.
Testing Instructions for Keyboard