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 Overflow to Clip #6738

Merged
merged 2 commits into from
Jun 22, 2023
Merged

Change Overflow to Clip #6738

merged 2 commits into from
Jun 22, 2023

Conversation

Lucien950
Copy link
Contributor

Consider the following situation

Suppose that there is a swiping element horizontally with a few elements, which grown when hovered. When it grows, it exeeds the Y axis overflow.
With overflow hidden, setting overflow-y to "visible" does nothing. However setting overflow to clip allows y-overflow to be visible.
This is as per the W3 Specification:

The visible/clip values of overflow compute to auto/hidden (respectively) if one of overflow-x or overflow-y is neither visible nor clip.

@Lucien950
Copy link
Contributor Author

There might be a few more instances where this can be changed, but these are the only ones that I found.

@Lucien950
Copy link
Contributor Author

I am also not 100% on all the side effects of this change, so that might be good to double check

@nolimits4web
Copy link
Owner

Would like to see a live example (better codesandbox) where it is used with Swiper

@Lucien950
Copy link
Contributor Author

Would like to see a live example (better codesandbox) where it is used with Swiper

I got you: CodePen

@nolimits4web
Copy link
Owner

@Lucien950 thank you. I will merge a bit later as it can be a breaking change, so this will land into upcoming v10

@nolimits4web nolimits4web changed the base branch from master to next June 22, 2023 08:10
@nolimits4web nolimits4web merged commit a8447b7 into nolimits4web:next Jun 22, 2023
@zarko-tg
Copy link

zarko-tg commented Jul 4, 2023

What if one needs overflow-y visible on the ".swiper" now? How to override?

@nolimits4web
Copy link
Owner

What if one needs overflow-y visible on the ".swiper" now? How to override?

Using CSS

@zarko-tg
Copy link

zarko-tg commented Jul 4, 2023

What if one needs overflow-y visible on the ".swiper" now? How to override?

Using CSS

Ah, just saw it's with part="container", I'll try, thanks.

@mateuswetah
Copy link

Hi @Lucien950! I was migrating a project from Swiper 8 to 10 and faced some issues regarding this change. I tried my best to reproduce it here:
https://codesandbox.io/s/agitated-moon-tjg9tt?fontsize=14&hidenavigation=1&theme=dark

When the overflow was hidden, both Swiper and the "something" content could expand as they needed in this layout. Now, due to the clip, the Swiper ends up growing more than it should. Would you have any suggestion on how could I achieve the same layout without forcing it to be hidden again?

Appreciate your support, if available :)

@Lucien950
Copy link
Contributor Author

image
I am not sure I understand the issue. They seem to be both expanding the same amount.

@mateuswetah
Copy link

I am not sure I understand the issue. They seem to be both expanding the same amount.

@Lucien950 that is weird... maybe browser or window size? I'm seeing this in my Firefox:
image

@Lucien950
Copy link
Contributor Author

I am not sure I understand the issue. They seem to be both expanding the same amount.

@Lucien950 that is weird... maybe browser or window size? I'm seeing this in my Firefox: image

I too see it on firefox. It is also strange that the arrows are not there. Perhaps these two problems are related?

@mateuswetah
Copy link

Yeah, definitely browser-related, it works on Chrome. The arrow does not appear because Swiper seems to believe it has enough space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants