PolymerElements / iron-swipeable-container

A container that allows any of its nested children to be swiped away.
25 stars 18 forks source link

expose IronSwipeableBehavior #11

Closed valdrinkoshi closed 8 years ago

valdrinkoshi commented 8 years ago

It would be useful for other elements like paper-toast https://github.com/PolymerElements/paper-toast/issues/6#issuecomment-161920074

abdonrd commented 8 years ago

:+1:

notwaldorf commented 8 years ago

Adding my comment from PolymerElements/paper-toast#6 (comment) here: I'm not sure I understand why this would help paper-toast. Swiping is an action that happens inside a container; it's not an attribute of an element. The goal of iron-swipeable-container is to allow swiping of anything in it. If you want a paper-toast to be swipeable, you need to put it in a container that allows this. Adding the IronSwipeableBehaviour to paper-toast would be an anti-pattern, in my opinion.

notwaldorf commented 8 years ago

iron-swipeable-container is literally the most generic implementation. It can swipe any of its children. I don't see how a different element implementing this behaviour could be any different than the current implementation -- i.e. you can just wrap that element into this container, rather than add the behaviour to that element and achieve basically the same thing.

Generally, I think duplicating functionality like this is bad -- I realize we'd be reusing the behaviour, but I think making "any element x" be a swipeable container is not great.

/cc @cdata to keep me straight