Problem with LVGL swipes and click button togther

First I would like to say swipes are awesome! Thanks @clydebarrow and others for getting them working!!! The effect is very cool when used with slide animation like this.

  on_swipe_right:
    then:
      - logger.log: "Right Swipe detected - Sliding page over to the right"
      - lvgl.page.next:
          animation: OUT_RIGHT
          time: 300ms

The problem is if you finger swipes across a button the button is also triggered.

I looked in the logs and both happen at the same time. But the Swipe happens first. Would it be possible to have “on_short_click:” disabled for the deration of the swipe or even just for 50ms or so after the swipe starts?

[14:54:00][D][main:069]: Right Swipe detected - Sliding page over to the right
[14:54:00][D][main:018]: Short click detected - turning on local light
[14:54:00][D][light:036]: 'local_light_button_1' Setting:
[14:54:00][D][light:047]:   State: ON

See Implement Swipe/Gestures as in upstream LVGL · Issue #3059 · esphome/feature-requests · GitHub for mitigation techniques.

But the fundamental problem is that swipes and interactive widgets don’t mix well. Consider using a tabview or tileview instead of pages - they react to dragging to switch views rather than a swipe as you are now using, which avoids much of the problem since the whole view moves with the finger.

Or for pages, consider only recognising swipes on a limited part of the screen.

Ok thanks, I’ll give that fix a try

It’s not perfect but it works much better like that.