-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block library: Refactor Paragraph block to use class name for text align #16794
Conversation
When I go to Gutenberg demo page locally I see lots of warnings on JS console. It looks like validation runs twice, but more importantly in this case I need to update HTML source of the demo content. I plan to open a related PR where I will improve the feedback shared on the JS console. It clearly is wrong as is, we should only let developers know that post was properly converted and show what was before and how it is coded from now on. @youknowriad, @aduth, @mtias or @mcsf, do you know why validation is triggered twice? |
@gziolo If I had to guess without looking, we have a few issues present in development environments due to how React fires
https://reactjs.org/docs/strict-mode.html#detecting-unexpected-side-effects For us, likely most problematic here:
|
Validation also runs for every deprecated version until it finds the "correct" version to use. I think the path forward would be to not show any error unless there's no corresponding deprecated version. |
@aduth, you are totally correct. I tried with
@youknowriad – I'm working on it in separate PR 👍 |
Applying |
0d7340d
to
ca3fff7
Compare
Any other block left with the inline styles for these? |
It is the last one I think. Well, at least I don't have more PRs opened :) We decided we don't add text-align to List block but it would be a new feature. |
…ign (#16794) * Block library: Refactor Paragraph block to use class name for text align * Fix demo post to use text align class for Paragraph blocks * Update snapshots for failing e2e tests * Improve code readabilit for Paragraph block
…ign (#16794) * Block library: Refactor Paragraph block to use class name for text align * Fix demo post to use text align class for Paragraph blocks * Update snapshots for failing e2e tests * Improve code readabilit for Paragraph block
Description
Related: #16027, #15751, #16777, and #16779.
This PR follows-up #16035.
Before:
After:
How has this been tested?
Using one of the existing branches (
master
probably) add a few Paragraph blocks and set different text alignments and save your post. Open the same post with this branch and ensure that it still worksChecklist: