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

Bug: Swipe card with nested button-cards on iOS #93

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

Bug: Swipe card with nested button-cards on iOS #93

Lorenzo-N opened this issue Sep 30, 2024 · 0 comments

Comments

@Lorenzo-N
Copy link

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.
Example configuration:

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

image

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.

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?

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

No branches or pull requests

1 participant