Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Swiper is inside a fixed position element and contains a form with inputs that extend beyond the viewport and can be scrolled #7728

Closed
5 of 6 tasks

Comments

@serg-quinta
Copy link

serg-quinta commented Sep 9, 2024

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/2wcfvm

Bug description

There is an issue when Swiper is inside a fixed position element and contains a form with inputs that extend beyond the viewport and can be scrolled. When scrolling to the last input and clicking on it, the keyboard opens. Afterward, if you try to click on another input outside the viewport, the form shifts unexpectedly, causing a different input to be selected than intended.
The issue is related to document.activeElement.blur(); code (https://github.com/nolimits4web/swiper/blob/869bb843735718c3c77551644cfd717bbf9e264e/src/core/events/onTouchStart.mjs#L142C5-L142C35).

Expected Behavior

Clicking on the expected input

Actual Behavior

Clicking on the wrong input

Swiper version

11.1.12

Platform/Target and Browser Versions

iOS Google Chrome 128, iOS Safari 17.6.1 The same behaviour on Android devices.

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
# for free to join this conversation on GitHub. Already have an account? # to comment