-
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
Pullquote: Adding block alignments and using proper placeholder #1268
Conversation
Nice! Thanks for working on this. When left floated, there's an issue with the layout. I think we need to port the following from being image only, to being for all things left aligned:
If you remove the placeholder text in the main body of the quote, you get an empty pullquote entirely: This is an interesting state. If you empty out the main field we should at least have "Write quote..." in the main. But the edgecase here is: do we also want it to show when the block is unselected? |
@jasmussen I've fixed the placeholder behaviour and I could use some help with the float left styling issue. I'm not sure I understand correctly and I'm not really aware of how these positioning work right now. |
Nice! I pushed a little alignment fix. More work needs doing, but I'll ticket/do that separately. I think we should get this in. |
blocks/editable/index.js
Outdated
! content || | ||
! content.length || | ||
// On non-inline editables, TinyMCE appends an empty <p> tag | ||
( ! this.props.inline && content.length === 1 && ! content[ 0 ].props.children ), |
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.
Could we hook into TinyMCE's internal empty checking?
https://github.com/tinymce/tinymce/blob/master/src/core/src/main/js/dom/Empty.js
I was wondering why we wouldn't have had to account for br[data-mce-bogus]
which is added similar to empty <p>
tag here. Appears we do some clean-up in getContent
already. Should we be stripping the empty paragraphs there?
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.
Thihs works great 👍
blocks/library/pullquote/index.js
Outdated
onChange={ | ||
( nextValue ) => setAttributes( { | ||
value: nextValue, | ||
} ) | ||
} | ||
placeholder={ ( 'Write Quote…' ) } |
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.
You forgot __
😄
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.
hahaha, hard to notice because it works
0e78102
to
d2d4a83
Compare
d2d4a83
to
9efa4c4
Compare
closes #1221
closes #1222
This PR enhances the pullquote block by adding block level alignment controls and is using a proper placeholder instead of default values.