-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
List Block: Fix numbering style to be applied correctly #53301
Changes from all commits
34593a3
974ef4e
8e2c68a
5be90bc
bcfd325
1885959
3e66d7d
b57f19a
c3bbf51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,16 @@ export default function save( { attributes } ) { | |
const { ordered, type, reversed, start } = attributes; | ||
const TagName = ordered ? 'ol' : 'ul'; | ||
return ( | ||
<TagName { ...useBlockProps.save( { type, reversed, start } ) }> | ||
<TagName | ||
{ ...useBlockProps.save( { | ||
reversed, | ||
start, | ||
style: { | ||
listStyleType: | ||
ordered && type !== 'decimal' ? type : undefined, | ||
}, | ||
} ) } | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we changing the save function if we're only needing to fix something in the admin? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this PR settled on the solution of using the inline style ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sorry, I misunderstood and thought this was the previous fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How were these styles injected into the frontend before this? Why did we decide to use inline styles now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the type attribute is deprecated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok Thanks for the details. 👍 |
||
<InnerBlocks.Content /> | ||
</TagName> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!-- wp:list {"ordered":true,"type":"upper-alpha"} --> | ||
<ol style="list-style-type:upper-alpha"><!-- wp:list-item --> | ||
<li>Item 1</li> | ||
<!-- /wp:list-item --></ol> | ||
<!-- /wp:list --> |
This file was deleted.
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.
Not sure why this was ignored for native. Does that have any consequences for the new inline style?
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.
Doesn't this line mean that the Edit component's
style
prop is used only on native platforms? This line appears to have originally been changed in #42711, which changed the List block to use nested blocks.https://github.com/WordPress/gutenberg/pull/42711/files#diff-99bb126c574fb4790a60e7b6cf372c8a8bce3114f8a9740d0f92e47e74238724R133