[Dojo-interest] DGrid DnD editor unable to gain focus from mouse pointer

Kenneth G. Franqueiro kgf at dojotoolkit.org
Thu Feb 4 09:38:35 EST 2016

This is probably unfortunately due to dojo/dnd's overzealous tendency to
eat events (i.e. call stopPropagation and preventDefault).  I suspect
it's not an issue with CheckBox widgets because it doesn't rely on
native browser click behavior and instead has code to handle it itself,
which would run before dojo/dnd even gets ahold of the event.

I suspect there are 2 approaches to resolve this:

1. Add listeners to every TextBox to call stopPropagation so that the
event never gets to dojo/dnd
2. Use dojo/dnd's withHandles feature by adding withHandles: true to
dndParams in the options you pass to the dgrid constructor, then add the
dojoDndHandle class somewhere unobtrusive in each row (for example, you
could add className: 'dojoDndHandle' to the id column's definition to
make items draggable only by cells in that column)

In a perfect world, dojo/dnd wouldn't eat events to begin with and there
would be no problem; I'm not sure if there's a historical reason why it


On 2/4/2016 8:49 AM, Greg Walters wrote:
> Hi, 
> I updated the JSFiddle to show how DnD does allow selection with a CheckBox,
> but not with a TextBox.
> https://jsfiddle.net/GregWalters/crt1be70/
> If anyone knows how to allow selection in a DnD TextBox, that would be
> great!!!
> Thanks,
> Greg
> --
> View this message in context: http://dojo-toolkit.33424.n3.nabble.com/DGrid-DnD-editor-unable-to-gain-focus-from-mouse-pointer-tp4006644p4006645.html
> Sent from the Dojo Toolkit mailing list archive at Nabble.com.

More information about the Dojo-interest mailing list