You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe you could add initialStateLeft/Right (boolean: opened / closed) Swipeable properties that would control whether the initial state is closed or swiped open.
Having some lists, sometimes it is useful to have the initial state to be opened for some rows/columns without the animation being present. With the current implementation, whatever is done outside of the swipeable core code doesn't look nice (at least with what I did).
A good example could be moving rows up/down in a list (added move up/down buttons). I am using your swipeable example code (from the example folder), but have two issues with how it is done. The first problem is with visuals. Once a row is told to be moved, the list is reordered / re-rendered. This is causing the list start with all items closed, then it performs swipeable animation. There is really no reason to have that animation to be performed, as it doesn't look good, or it is rather confusing.
The second problem (with my implementation) is that I am triggering the opening in componentDidMount (of AppleSwipeableRow). Unfortunately, just triggering it there is not doing much, as at least in what I have there, there are a couple of more renders that force that open request to be canceled. To still be able to force that open, I need to delay that opening with setTimeout.
That said, my implementation kind of sucks due to that setTimeout and some goofy numbers that go with it. Also, it doesn't help with a smooth reordering of the list (first the list is reordered, and then kind of out of the blue proceeds to perform swiping animation).
Having that initialStateLeft/Right property would simplify / reduce the code for a lot of us that are using your package. Moreover, the visual part would look much better.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Maybe you could add initialStateLeft/Right (boolean: opened / closed) Swipeable properties that would control whether the initial state is closed or swiped open.
Having some lists, sometimes it is useful to have the initial state to be opened for some rows/columns without the animation being present. With the current implementation, whatever is done outside of the swipeable core code doesn't look nice (at least with what I did).
A good example could be moving rows up/down in a list (added move up/down buttons). I am using your swipeable example code (from the example folder), but have two issues with how it is done. The first problem is with visuals. Once a row is told to be moved, the list is reordered / re-rendered. This is causing the list start with all items closed, then it performs swipeable animation. There is really no reason to have that animation to be performed, as it doesn't look good, or it is rather confusing.
The second problem (with my implementation) is that I am triggering the opening in componentDidMount (of AppleSwipeableRow). Unfortunately, just triggering it there is not doing much, as at least in what I have there, there are a couple of more renders that force that open request to be canceled. To still be able to force that open, I need to delay that opening with setTimeout.
That said, my implementation kind of sucks due to that setTimeout and some goofy numbers that go with it. Also, it doesn't help with a smooth reordering of the list (first the list is reordered, and then kind of out of the blue proceeds to perform swiping animation).
Having that initialStateLeft/Right property would simplify / reduce the code for a lot of us that are using your package. Moreover, the visual part would look much better.
Beta Was this translation helpful? Give feedback.
All reactions