ember-drag-drop icon indicating copy to clipboard operation
ember-drag-drop copied to clipboard

Question regarding validation

Open oddnavy opened this issue 10 years ago • 2 comments

Great addon!

Bit of a ember component novice and I'm wondering how I could go about validating the drop event based on the contents of the model and then cancel it if certain parameters are no met.

Thanks!

oddnavy avatar Nov 25 '14 23:11 oddnavy

Great question. Right now I don't think so, but that kind of hook is definitely needed. I'll check it out.

Thanks for the issue!

mharris717 avatar Nov 26 '14 01:11 mharris717

Just adding that I'd be very keen to see this implemented. I.e. for each draggable object, to be able to specify the allowed draggable targets (or vice-versa ... for a target, specify the allowed draggables). It could be as complex as a full-blower validator ... or it could be as specifying a droppable key e.g. "posts" which would dictate that only draggable objects with key="posts" can be dropped into targets with key="posts" (and it's the user's responsibility to set these keys beforehand, which essentially makes this equivalent to validators).

kodonnell avatar Feb 13 '15 03:02 kodonnell