-
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
Blocks: Add direction attribute / LTR button to paragraph block #10663
Changes from all commits
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 |
---|---|---|
|
@@ -65,6 +65,10 @@ const schema = { | |
customFontSize: { | ||
type: 'number', | ||
}, | ||
direction: { | ||
type: 'string', | ||
enum: [ 'ltr', 'rtl' ], | ||
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. do we support this 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. Not yet 😉 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. Well, to clarify, it's supported in the server-side validation, but isn't ported to the client. Idea with adding here now is it "just works" when ported. 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. There's probably a lot of block attributes where this could be considered. 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. Related: #10635, #9829 (comment) |
||
}, | ||
}; | ||
|
||
export const name = 'core/paragraph'; | ||
|
@@ -230,6 +234,7 @@ export const settings = { | |
customTextColor, | ||
fontSize, | ||
customFontSize, | ||
direction, | ||
} = attributes; | ||
|
||
const textClass = getColorClassName( 'color', textColor ); | ||
|
@@ -258,6 +263,7 @@ export const settings = { | |
style={ styles } | ||
className={ className ? className : undefined } | ||
value={ content } | ||
dir={ direction } | ||
/> | ||
); | ||
}, | ||
|
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.
In case this raises eyebrows, the hope / intention is to inherit the existing string:
https://github.com/WordPress/WordPress/blob/da7a80d67fea29c2badfc538bfc01c8a585f0cbe/wp-includes/class-wp-editor.php#L1128