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 Next nav button doesnt work on last slide #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

halilnevzat
Copy link

This pull request introduces a dynamic solution to account for cumulative parent element paddings in Swiffy Slider. The changes ensure that the slider functions seamlessly, even when placed inside containers with various padding values. The fix dynamically calculates the cumulative padding of all parent elements and adjusts the slider's CSS variables accordingly, resolving layout and functionality issues in complex DOM structures.

bootstrap container padding right and left caused this problem in my case, i've spent 5 hours to fix this. further tests might be needed.

This pull request introduces a dynamic solution to account for cumulative parent element paddings in Swiffy Slider. The changes ensure that the slider functions seamlessly, even when placed inside containers with various padding values. The fix dynamically calculates the cumulative padding of all parent elements and adjusts the slider's CSS variables accordingly, resolving layout and functionality issues in complex DOM structures.
@nicped
Copy link
Member

nicped commented Dec 5, 2024

Thank you for the pull request and the interest in Swiffy Slider.

I am not sure I fully understand exactly what problem this pull request fixes as there is no issue detailing any rendering or layout problems with examples of how to reproduce and explanation of how this pull request would fix said problem.

2 things to consider

  • Swiffy Slider is in nature kept as simple as possible and made in a way to avoid CLS since all rendering is handled by initial HTML and CSS load. This pull request seems to be fiddling with CSS after the slider has been rendered and that is not desired as that is in opposition to the base idea of this library. I am convinced that whatever issue you are facing it can be solved more elegantly in CSS if it relates to paddings of nested sliders - probably in your site CSS, and not Swiffy Slider CSS.
  • To keep the library small and simple by nature, which is another very important goal of Swiffy Slider, adding a feature that targets a very limited portion of implementations should not be merged into the library. If we did this 10 times to address very specific and rare issues, the library would grow significantly in size benefiting few implementations, but hurt most in performance, and would make the code more complex than desired.

Hope you understand my way of thinking. Keep things simple and small, hence effective and easy to deal with.

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.

2 participants