Attached is a patch to add a new HasDragExclusion interface that drag
handlers can implement in order to indicate whether a particular click
should be considered for dragging or excluded. In my case, I am using
it to exclude clicks on form elements, although this could be useful
for other use cases, such as temporarily disabling click capturing
based on application state, etc. See below for an example
implementation of this interface:
public boolean shouldExcludeDrag(EventTarget eventTarget) {
if(Element.is(eventTarget)) {
String targetTagName = Element.as(eventTarget).getTagName();
if(targetTagName.equalsIgnoreCase("input") ||
targetTagName.equalsIgnoreCase("select") ||
targetTagName.equalsIgnoreCase("textarea") ||
targetTagName.equalsIgnoreCase("option")) {
return true;
}
}
return false;
}
@Override
public boolean shouldExcludeMouseDrag(MouseDownEvent mouseDownEvent) {
return
shouldExcludeDrag(mouseDownEvent.getNativeEvent().getEventTarget());
}
@Override
public boolean shouldExcludeTouchDrag(TouchStartEvent touchStartEvent) {
return
shouldExcludeDrag(touchStartEvent.getNativeEvent().getEventTarget());
}
Please let me know if you have any questions or comments, or if you
know of any way to implement the same behavior without this patch.
Thank you,
Nathan Byrd
Nathan Byrd
--
You received this message because you are subscribed to the Google Groups "gwt-dnd" group.
To post to this group, send email to gwt...@googlegroups.com.
To unsubscribe from this group, send email to gwt-dnd+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-dnd?hl=en.
Thank you,
Nathan