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

Unable to scroll block style switcher #16028

Closed
timelsass opened this issue Jun 7, 2019 · 3 comments
Closed

Unable to scroll block style switcher #16028

timelsass opened this issue Jun 7, 2019 · 3 comments
Labels
[Feature] Theme Style Variations Related to style variations provided by block themes [Type] Bug An existing feature does not function as intended

Comments

@timelsass
Copy link
Contributor

When adding several variations to block styles for a single block, if the list goes beyond the visual area seen, there's no way possible for a user to see or access the rest when clicking on the block style switcher by scrolling in that area.
image

possibly related to #10905

@swissspidy swissspidy added [Feature] Theme Style Variations Related to style variations provided by block themes [Type] Bug An existing feature does not function as intended labels Jun 7, 2019
@senadir
Copy link
Contributor

senadir commented Jun 7, 2019

problem seems to be easily fixable by adding a max-height and overflow-y: auto to .components-popover__content but it seems to be purposely made to overflow-y: visible

.block-editor-block-switcher__popover:not(.is-mobile) > .components-popover__content {
// Reset overflow to allow showing the preview on the left once an item is hovered.
overflow-y: visible;

this change was made in this commit to fix this issue #8623 in this pull request #8962
basically it fixes a bug in IE11

the use of overflow-y: initial or overflow-y: visible is the same, since the initial value is visible, so we probably need to understand why initial was used to begin with

@senadir
Copy link
Contributor

senadir commented Jun 7, 2019

as far as I managed to dig, this fix was because the preview panel will not show up if overflow-y is anything other then visible. and using overflow-x will not work.
that's because, according to MDN

If overflow-y is hidden, scroll or auto and this property [overflow-x] is visible (default) it will implicitly compute to auto.

and if .components-popover__content is not visible, the preview won't show up, in this image, it is auto
image

so a solution I managed to make was to wrap .components-popover__content in a div, take .ditor-block-preview out of .components-popover__content and into the parent div, migrate some styles from the .components-popover__content to the parent (like background, size, position and what about)
double the width of the parent, and give .components-popover__content 50% of it, preserving the same visual structure but fixing it.

  • This is an example, we have a popover component that is too long, I applied max height to but the overflow is still a problem
    image

  • The same example with long content, with overflow fixed and preview working
    image

this implementation still requires a lot of refactoring (since I switched from position: absolute to flexbox)
I will try to refactor it and make a PR

@youknowriad
Copy link
Contributor

This is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Theme Style Variations Related to style variations provided by block themes [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants