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

Fix: Block alignment css rules affecting nested blocks #10142

Merged

Conversation

jorgefilipecosta
Copy link
Member

Description

Some CSS rules to apply left and right alignment used the CSS children selector instead of direct children selector. This caused some bugs on nested blocks.
It was discovered during the PR #10141 where the bug caused some troubles.
Note that for wide alignment direct children selector was being correctly used.

How has this been tested?

I added the test block available in https://gist.github.com/jorgefilipecosta/78f206b7c5a28458b54b2abce04787e8 ( pasted it in the console).
I made the block right aligned and verified the block kept its shape.

Screenshots

Before:
screen shot 2018-09-24 at 19 49 20

After:
screen shot 2018-09-24 at 19 52 26

@jorgefilipecosta jorgefilipecosta force-pushed the fix/block-alignment-css-rules-nested-blocks branch from 113699f to 8108f5c Compare September 24, 2018 19:02
&[data-align="right"] > .editor-block-contextual-toolbar > .editor-block-toolbar {
/*!rtl:begin:ignore*/
float: right;
/*!rtl:end:ignore*/
Copy link
Member Author

Choose a reason for hiding this comment

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

Previous we did not have rtl end for this rule. I'm almost certain that it was a bug and "end" should have been present but It would be perfect if someone could double check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, thank you.

@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Sep 24, 2018
Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this. This is working well for me and doesn't appear to have any downsides.

@jorgefilipecosta jorgefilipecosta merged commit fdf5c39 into master Sep 25, 2018
@jorgefilipecosta jorgefilipecosta deleted the fix/block-alignment-css-rules-nested-blocks branch September 25, 2018 08:27
@jorgefilipecosta
Copy link
Member Author

Thank you for the review @jasmussen!

@jorgefilipecosta jorgefilipecosta added this to the 4.0 milestone Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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