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

Swipe card with nested button-cards on iOS #873

Open
2 tasks done
Lorenzo-N opened this issue Sep 30, 2024 · 0 comments
Open
2 tasks done

Swipe card with nested button-cards on iOS #873

Lorenzo-N opened this issue Sep 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Lorenzo-N
Copy link

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser

Describe the bug
Hi, if I have a swipe-card containing a button-card with sub-elements inside (as in many templates of Lovelace Minimalist UI), swipe doesn't work on iOS, both in Safari and the app.

Version of the card
Version: 4.1.2

To Reproduce
This is the configuration I used:

type: custom:swipe-card
cards:
  - type: custom:button-card
    name: Outer element
    styles:
      grid:
        - grid-template-areas: '"item1" "n"'
    custom_fields:
      item1:
        card:
          type: custom:button-card
          name: Nested element

Screenshots
image

Expected behavior
In the example, if the swipe starts from the outer element, it works correctly. However, if it starts from the nested element, it doesn't move, as if the nested element stops the propagation of touch events. On Windows, it works fine even when simulating a mobile device via Inspect Element.

Desktop:

  • Browser chrome

Smartphone:

  • Device: iPhone 13 Pro
  • OS: iOS 18.0
  • Browser safari

Additional context
The only solutions I've found are:

  • Adding pointer-events: none to the nested element, but this prevents all click events as well.
   card_mod:
      style: |
        #item1 {
          pointer-events: none;
        }
  • Enabling the cssMode of Swiper, but with this, only the basic slide effect works.

Has anyone encountered the same issue? How can I solve it?

@Lorenzo-N Lorenzo-N added the bug Something isn't working label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant