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

Change z-index override logic for popovers. #17696

Merged
merged 4 commits into from
Oct 3, 2019
Merged

Conversation

tellthemachines
Copy link
Contributor

@tellthemachines tellthemachines commented Oct 2, 2019

Description

New popovers in the sidebar won't display on mobile because of their z-index. This fixes that issue.

Found this issue while working on #17418 - turns out that :not(.is-mobile) actually targets all mobile instances of Dropdown/Popover unless they are also set to expandOnMobile.

The rule I'm removing was originally added to stop popovers at the top of the page from hiding the wp-admin bar dropdowns, but it is too general so over time a bunch of overrides for it have been added.

My change removes that rule and the overrides, and instead adds specific rules to keep the z-index of the top-of-the-page popovers under wp-admin dropdowns.

Steps to test

Open editor on desktop. Click to open block inserter, table of contents, or block navigation in the top toolbar, then hover over "+ New" on wp-admin bar so that the dropdown appears. Verify that the wp-admin dropdown is displaying over the popover from the editor toolbar.

Open editor on mobile. Select a text block and open settings bar for the block. Go to "Color settings"; clicking on "custom color" should bring up a popover.

How has this been tested?

Checked all the popovers I could find in the editor, on desktop and (emulated) mobile. Triple-checked the ones I added or removed specific rules for.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label Oct 2, 2019
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.

In my testing, this works well, thank you for the PR! Testing steps pass:

Screenshot 2019-10-02 at 10 02 15

Screenshot 2019-10-02 at 10 03 09

I like the simplified code, and in testing various other popovers, things seemed good to me.

I left one comment about a gradient syntax change that seems unrelated to the PR, but other than that, this works for me.

theme(button) 72%
);
background-image:
linear-gradient(-45deg, theme(button) 28%, color(theme(button) shade(20%)) 28%, color(theme(button) shade(20%)) 72%, theme(button) 72%);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for this change other than personal preference?

Gradients always give me headaches, and although it's not really a coding pattern to split on to multiple lines, when actually working on these gradients and tweaking them, it really helps that they're on multiple lines. I'd prefer the old version unless there's a good reason to change this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oooh interesting. Stylelint changed that automatically so I guess the /* stylelint-disable */ comment above is being ignored for some reason. I'll revert that as it's unrelated to this changset 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks for the review @jasmussen !

@tellthemachines tellthemachines merged commit f8f451f into master Oct 3, 2019
@tellthemachines tellthemachines deleted the fix/popover-zindex branch October 3, 2019 02:50
@youknowriad youknowriad added this to the Gutenberg 6.7 milestone Oct 14, 2019
gziolo pushed a commit that referenced this pull request Oct 15, 2019
* Change z-index override logic for popovers.

* Undo gradient formatting.

* Remove import of deleted file.

* Remove empty file, fix reference to deleted zindex
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.

3 participants