Angular-tree-component: Tab is not hitting tree component

Created on 28 Feb 2017  Â·  12Comments  Â·  Source: CirclonGroup/angular-tree-component

I have tree component in my page. When I press tab, I don't see it's hitting tree component. I have to use mouse to select one of the node, and then only I can do keyboard navigation which seems to be usability issue to me. Please let me know if I am missing something.

bug

All 12 comments

May I get some update here please, at least a pointer to how I can achieve it by either modifying this component or from outside.

Hi,
I can't reproduce, in the example it works for me.
Can you share your code?

Please check following plunkr. https://plnkr.co/edit/Zm98g3kT6yU7XWcUwTvX?p=preview.

If you hit tab, button will be highlighted and tree component is never touched

Hi,
I hope to have time to look at it during the weekend

--

On Fri, Mar 10, 2017 at 8:49 AM, debslab notifications@github.com wrote:

Please check following plunkr. https://plnkr.co/edit/
Zm98g3kT6yU7XWcUwTvX?p=preview.

If you hit tab, button will be highlighted and tree component is never
touched

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/500tech/angular-tree-component/issues/199#issuecomment-285592036,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA2SSseEEK_cCqB9MQD0hEp0njRuP8xsks5rkPJtgaJpZM4MN7Fr
.

Any updates here?? I too have the same issue .

Any updates here ?

hi ,

any update here? even after setting the focus on the first node , key navigation doesn't work. we need to click the node and then the traversing happens.

And also the tab doesn't on tree .

Hey @AngularTx,
Did you try to debug it?

nope. during testing I found that .

Did you get time to take a look at the issue ?

On Jul 11, 2017 8:14 AM, "adam klein" notifications@github.com wrote:

Hey @AngularTx https://github.com/angulartx,
Did you try to debug it?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/500tech/angular-tree-component/issues/199#issuecomment-314340978,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AStMS3sfR0Uy0J0I62ueusl6Bu-x9T-iks5sMxK2gaJpZM4MN7Fr
.

Got a big issue backlog. It will be very helpful if you try to debug it -
thanks!

--

On Wed, Jul 12, 2017 at 8:23 PM, AngularTx notifications@github.com wrote:

nope. during testing I found that .

Did you get time to take a look at the issue ?

On Jul 11, 2017 8:14 AM, "adam klein" notifications@github.com wrote:

Hey @AngularTx https://github.com/angulartx,
Did you try to debug it?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
199#issuecomment-314340978>,
or mute the thread
AStMS3sfR0Uy0J0I62ueusl6Bu-x9T-iks5sMxK2gaJpZM4MN7Fr>

.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/500tech/angular-tree-component/issues/199#issuecomment-314838570,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA2SSjYIboMGRp1mUeXrlYtoiu_zu2bHks5sNQD0gaJpZM4MN7Fr
.

I did have the same problem. My solution looks like this:

I add an eventlistener to the "enter" key. Only then the user can use left and right arrow to navigate. When "enter" is pressed I mark the node I want with this function:

  markNode(idOfNode) {
    this.tree.setFocus(true);
    const node = this.tree.getNodeById(idOfNode);
    this.tree.setActiveNode(node, true, false);
    const activeNode = this.tree.getActiveNode();
    let myElement = document.querySelector('#l-' + activeNode.data.id) as HTMLElement;
    this.renderer.invokeElementMethod(myElement, 'focus');
  }

The key to this is the
this.tree.setActiveNode(node, true, false);

Then the arrow keys work. In my template I do have a invisible checkbox and a label. I do want the label to receive the focus.

Hope this helps.

@Suncrusher: can you please create a stackblitz so that I can have a look at it? I don't think the first issue is still solved. I also tried to set the [focused]="true" on tree node however, the tab still does not hit the tree as mentioned in the original question.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vishnusangam picture Vishnusangam  Â·  4Comments

JanSchuermannPH picture JanSchuermannPH  Â·  4Comments

filipemansano picture filipemansano  Â·  5Comments

Roman-Simik picture Roman-Simik  Â·  5Comments

olastor picture olastor  Â·  5Comments