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

chore: Fix: Paragraph block isRTL may not be boolean #18526

Merged

Conversation

jorgefilipecosta
Copy link
Member

Description

If the block editor provider does not provide an isRTL setting, isRTL may be undefined.
ParagraphRTLToolbar returns isRTL && (...), so it may return undefined making the block crash.
It is possible to see this problem by opening the widget block screen and trying to use a paragraph, as the widgets screen does not provide an isRTL setting.
Widgets screen should provide isRTL that will be fixed in a different PR, but the paragraph block should not rely on isRTL being available, so this PR still fixes a problem.

How has this been tested?

I opened the widget blocks screen.
I added a paragraph, wrote something, and verified the paragraph did not crash.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Block] Paragraph Affects the Paragraph Block labels Nov 14, 2019
@jorgefilipecosta
Copy link
Member Author

Without this straightforward change, it is hard to test the widgets screen in other PR's, so I am going to merge this. If there is any suggestion, anyone would like to make, please leave a comment, and I will open a follow-up PR.

@jorgefilipecosta jorgefilipecosta merged commit 8fcef7e into master Nov 14, 2019
@jorgefilipecosta jorgefilipecosta deleted the fix/paragraph-block-isRtl-may-not-be-a-boolean branch November 14, 2019 18:44
@youknowriad youknowriad added this to the Gutenberg 7.0 milestone Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants