Post Comments Count: Prevent text-decoration from affecting warning#43497
Merged
aaronrobertshaw merged 2 commits intotrunkfrom Aug 23, 2022
Merged
Conversation
6 tasks
|
Size Change: -19 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Contributor
andrewserong
left a comment
There was a problem hiding this comment.
Thanks for following up @aaronrobertshaw! Overall I think the approach of stripping out the styles we don't want at the block level when rendering the placeholder is the right way to go for blocks that use placeholders. I ran into an issue with being able to select the block from the place holder, though. Just left a couple comments.
Happy to do more testing later on!
The previous changes broke selection of the block. This refactor allows the block to be selectable again.
andrewserong
approved these changes
Aug 23, 2022
Contributor
andrewserong
left a comment
There was a problem hiding this comment.
Nice one, thanks for fixing that up @aaronrobertshaw, and good that it resulted in a smaller diff, too!
I can select the placeholder state:
And the "real" rendering of the block still works as expected:
LGTM ✨
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Related:
What?
Prevents
text-decorationsupport styles from being applied to the block's warning.Why?
Text decoration is rendered differently than other typographic styles and can't be reset via CSS once applied to a parent.
How?
Given the warning is only displayed in the editor while the block is rendered outside a post context, we can avoid applying the text decoration to the block's wrapper when it contains the warning.
Testing Instructions
Screenshots or screencast
Screen.Recording.2022-08-23.at.2.23.11.pm.mp4
Screen.Recording.2022-08-23.at.3.29.30.pm.mp4