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
As far as i know, the proper way to toggle of the dragging feature on selectable elements (which is default on), is by overriding Drag.filterDragElements, so i tried the following on my Next 14.2 code after following the React setup guide:
// @ts-ignore: Accessing private propertyconstdragInstance=ds.Dragif(dragInstance){dragInstance.filterDragElements=()=>false// optionally tried to return an empty array}
I may be dumb but the main idea is to filter everything out so that no item is, in fact, draggable.
The result i obtain is that i can still drag my items arround for the best case (where i let the filter untouched and return all items), whereas in worst case scenario i can drag once, and every drag of the item after that cause an error of "Cannot read properties of undefined (reading 'forEach')")
I tried bunch of workarround solutions aside, like subscribing an empty callback on DS:start, setting the html "draggable" atribute to false on all my items components, disabling user-select on css properties etc, but nothing worked yet
Thanks for the tool, it's great, tho help would be very appreciated
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
-
Hey,
i've read https://dragselect.com/docs/API/Overrides and #204
As far as i know, the proper way to toggle of the dragging feature on selectable elements (which is default on), is by overriding Drag.filterDragElements, so i tried the following on my Next 14.2 code after following the React setup guide:
I may be dumb but the main idea is to filter everything out so that no item is, in fact, draggable.
The result i obtain is that i can still drag my items arround for the best case (where i let the filter untouched and return all items), whereas in worst case scenario i can drag once, and every drag of the item after that cause an error of "Cannot read properties of undefined (reading 'forEach')")
I tried bunch of workarround solutions aside, like subscribing an empty callback on DS:start, setting the html "draggable" atribute to false on all my items components, disabling user-select on css properties etc, but nothing worked yet
Thanks for the tool, it's great, tho help would be very appreciated
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions