-
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
Table of Contents block: remove editor-only wrapper <div>
.
#40899
Table of Contents block: remove editor-only wrapper <div>
.
#40899
Conversation
Size Change: +13 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
I'm not sure how to do it? I tried it but no luck! Could you help me how to make |
@amustaque97 What I mean is that the links in the Table of Contents block shouldn't go anywhere when clicked. |
You mean convert to static list? OR Do I need to |
@amustaque97 No, I mean that that clicking the links in the Table of Contents block should only ever select the block, and not activate the links (in contrast to the front-end behavior). |
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.
Tested the changes. It works as expected. Thank you for working on this @ZebulanStanphill 👏👏👏
What?
This PR removes the extra
<div>
in the Table of Contents block editor markup between the<nav>
and<ol>
.Why?
This makes the markup consistent between the editor and front-end, which will be helpful for future PRs. Specifically, I was working on a PR to add color controls to this block, and I didn't want to write editor-only styles to deal with the extra
<div>
.How?
By switching to
useDisabled
instead of the<Disabled>
component, we can disable the<ol>
of the Table of Contents directly, instead of having to wrap it.Testing Instructions
trunk
.