Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard focus not working when using dnd extension #270

Closed
ArnoldSchuitema opened this issue Jun 24, 2014 · 7 comments
Closed

Keyboard focus not working when using dnd extension #270

ArnoldSchuitema opened this issue Jun 24, 2014 · 7 comments

Comments

@ArnoldSchuitema
Copy link

For example at http://www.wwwendt.de/tech/fancytree/demo/sample-ext-dnd.html
If you click a node it is not possible to navigate with the keyboard. In the other examples it is working fine.

@mar10 mar10 added the bug label Jun 25, 2014
@mar10 mar10 added this to the 2.x Backlog milestone Jun 25, 2014
@mar10
Copy link
Owner

mar10 commented Jun 26, 2014

@ArnoldSchuitema
Copy link
Author

Thanks, its working now!

Kind regards,

Arnold Schuitema

2014-06-26 22:13 GMT+02:00 Martin Wendt notifications@github.com:

Probably related to this:

http://stackoverflow.com/questions/16916711/why-does-clicking-a-drag-handle-not-steal-away-text-focus


Reply to this email directly or view it on GitHub
#270 (comment).

@mar10
Copy link
Owner

mar10 commented Jun 27, 2014

I thought about modifying ext-dnd by adding a mousedown handler and set focus to the container if dragging is enabled.

How did you solve it?

@mar10 mar10 reopened this Jun 27, 2014
@mar10 mar10 added enhancement and removed bug labels Jun 27, 2014
@mar10
Copy link
Owner

mar10 commented Jun 28, 2014

Addressed by daf11c2

@mar10
Copy link
Owner

mar10 commented Aug 28, 2014

(#300 is about another problem, introduced between jQuery UI 1.10.4 and 1.11.1)

The reason for #270 is that jQuery UI draggable cancels its mousedown event

[jQuery UI 1.11 - Draggable]

var mouse = $.widget("ui.mouse", {
  ...
  _mouseDown: function(event) {
    ...
    this.document
      .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
      .bind( "mouseup." + this.widgetName, this._mouseUpDelegate );

    event.preventDefault();

    mouseHandled = true;
    return true;
},

@krash84
Copy link

krash84 commented Apr 16, 2015

Hello!
I've found that the following example doesn't work if you do next steps:

  1. mouse click on a node,
  2. navigate with keys (works fine),
  3. again mouse click on a node => keyboard navigation is broken.
    http://www.wwwendt.de/tech/fancytree/demo/sample-ext-dnd.html

This is because the tree already has focus, and the next line in DND extension doesn't let the node to be focused again:

(in treeInit:)
if( !tree.hasFocus() && ctx.options.dnd.focusOnClick ) { // the tree already has focus at the step 3

My workaround is just to remove "!tree.hasFocus() &&" part:

if(ctx.options.dnd.focusOnClick )

@mar10
Copy link
Owner

mar10 commented Apr 18, 2015

I will apply the sugegsted patch, let's see what happens...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants