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

Focus on tree element after reload #156

Closed
opreisSys opened this issue Oct 11, 2023 · 11 comments
Closed

Focus on tree element after reload #156

opreisSys opened this issue Oct 11, 2023 · 11 comments
Labels
help wanted Extra attention is needed

Comments

@opreisSys
Copy link

opreisSys commented Oct 11, 2023

Problem description

After executing a context action on a tree element, the focus is lost and the user has to navigate again to the modified location in the tree.

Example:
The user clicks on a menu at a tree element, which opens a dialog. The user changes the tree there (add, delete, edit an element). Afterwards the dialog closes and the tree is reloaded. The keyboard focus on the original tree element is lost and the user starts again in the tree above.

Currently it is not possible for me to manually set the focus in the tree. (Or is it?)

Possible solution

It would be helpful to set the focus manually/controlled on a tree element. This way the user comes back to his starting point and can continue there.

@dgreene1
Copy link
Owner

We’d be open to a PR if you want to submit it but I can’t promise it will be merged since there are normal react, jquery, and browser API ways to do this.

@opreisSys
Copy link
Author

Yes there are normal ways to set the focus, but not in such a way that the tree accepts it properly. If I set the focus on a tree element and want to navigate from there with the keyboard, the focus starts again at the top of the tree.

@dgreene1
Copy link
Owner

Okay. We’ll review your PR if you’d like to submit one.

@dgreene1 dgreene1 added the help wanted Extra attention is needed label Oct 16, 2023
Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 15, 2023
Copy link

stale bot commented Dec 22, 2023

This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot closed this as completed Dec 22, 2023
@Ethaan
Copy link

Ethaan commented Mar 21, 2024

@opreisSys did you manage to solve this? i'm trying to put the keyboard focus on the first element id inside defaultExpandedIds but no luck

@opreisSys
Copy link
Author

@opreisSys did you manage to solve this? i'm trying to put the keyboard focus on the first element id inside defaultExpandedIds but no luck

I currently have no capacity to fix it. But I still need a solution here, because it is an accessibility problem.

@dgreene1
Copy link
Owner

Can you provide documentation that this is an accessibility problem? It appears to be a usability problem.

I’ll reopen the issues so that someone might contribute it. But currently it’s out of scope for my team too.

help wanted.

@dgreene1 dgreene1 reopened this Mar 22, 2024
@stale stale bot removed the wontfix This will not be worked on label Mar 22, 2024
@opreisSys
Copy link
Author

@dgreene1 Thank you for reopening the issue!
From my point of view, it is both an usability and accessibility problem.

  1. a blind user navigates in the tree using the keyboard and opens a dialog from there.
  2. user is in the dialog and rerenders the tree when closing the dialogue.
  3. user loses focus in the tree and has to find the location again.

As I mentioned above, unfortunately it does not help to set the focus with browser API methods, as the tree does not accept it and navigates from there back to the top of the tree.

As soon as I have found the relevant place in the accessibility guidelines, I will get back to you.

@yhy-1
Copy link
Collaborator

yhy-1 commented Apr 29, 2024

opreisSys Can you try with the new focus props? V2.9.0

@opreisSys
Copy link
Author

opreisSys Can you try with the new focus props? V2.9.0

Oh super! This property solved my problem. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants