Skip to content

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

@serg-quinta

Description

@serg-quinta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions