Skip to content
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: Render Button RichText as div #8451

Merged
merged 2 commits into from
Aug 8, 2018
Merged

Conversation

aduth
Copy link
Member

@aduth aduth commented Aug 3, 2018

Fixes (one of two) #8440

This pull request seeks to resolve an issue where removing all text from a Button block by backspace would cause subsequent text changes to not be accurately reflected.

It's expected that this is a broader issue with TinyMCE compatibility of inline elements as the root container of a text field (see also tinymce/tinymce#4488). This may be something we want to avoid altogether, instead applying equivalent inline behaviors by styling. As implemented in the Button component, the default div visually appears identical and resolves the issue described in #8440.

Since I've also noticed issues with the Quote block's use of the cite element, I may propose that we consider avoiding inline elements for all instances of RichText. I will create a separate issue for this if agreeable.

Testing instructions:

Repeat steps to reproduce from #8440 (comment) , verifying that all text changes are respected. It should also behave differently in that the Placeholder will be shown again when all text is removed by Backspace.

Verify there are no styling regressions in the display of the Button block in the editor.

@aduth aduth added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks labels Aug 3, 2018
@spencerfinnell
Copy link

This fixes the text issue for me.

@aduth aduth force-pushed the fix/8440-button-inline-rich-text branch from 1931280 to 3e3cc92 Compare August 3, 2018 17:36
@aduth aduth force-pushed the fix/8440-button-inline-rich-text branch from 3e3cc92 to 8260b5d Compare August 4, 2018 20:53
@youknowriad
Copy link
Contributor

Related #8531

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@aduth
Copy link
Member Author

aduth commented Aug 9, 2018

Follow-up issue at #8773 for converting other RichText inline elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants