PredixDev/px-table-view

Swipe Left property is confusing

Opened this issue · 2 comments

In the px-table-row demo when swipeable is selected the buttons are not right aligned.
If swipe left is true it right aligns the buttons, this seems backwards.

I believe the semantics are correct - "swipe left" means you're meant to swipe [from right to] left. The weirdness comes in because when swipe left is turned off, you can still swipe from right to left and the row still moves and the buttons are exposed in that weird fashion. And the opposite when swipe left is turned on, you shouldn't be able to swipe from left to right.

I've made a few changes that hopefully make this clearer:

  • If swipeable is turned on but swipeLeft and swipeRight are both false, it doesn't move
  • I made swipeRight true by default and made the demo behave so that if the swipeLeft toggle is triggered, it flips both properties so they're always opposite of each other

Ideally, if swipeLeft is true but swipeRight is false, the row shouldn't move at all when you attempt to swipe it right (and vice versa). The code comments even make it sound like this is the case, but I can't figure out what Jonnie was intending or how to get it working correctly. Will leave this issue open for future reference.