vue-dragscroll
vue-dragscroll copied to clipboard
fix: deep data attributes scan
In my mind, the common behaviour for "data-no-dragscroll" and "data-dragscroll" would be that it takes the data attributes on the parent elements into account too.
Use closest selector to determine if there is a parent element that contains a data attribute. Therefore we no longer need to define the data-attribute on every child.
Element.closest does not work with IE11. Needs a polyfill.
is this going to break previous versions ?
Yes, it is a breaking change because the default behaviour of the inner element will change.
Maybe something vor v2?
If you would like too keep current behaviour we could change it to something like
data-no-dragscroll="all"
or even a new data attribute like.
It does not take into account, that a 'data-dragscroll' could countaint antoher 'data-no-dragscroll'.
Okey, you are right, but I need to resolve one issue that is currently on the v1 before going to v2