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

jorgefilipecosta commented Nov 14, 2019

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

This comment has been minimized.

Copy link
Member Author

jorgefilipecosta commented Nov 14, 2019

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
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@jorgefilipecosta jorgefilipecosta deleted the fix/paragraph-block-isRtl-may-not-be-a-boolean branch Nov 14, 2019
@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
Projects
None yet
2 participants
You can’t perform that action at this time.