Hi guys,
here is an patch to give this awesome module more awesomeness: keyboard navigation. Just press escape key and go on.

It's clone of the default Leopard keyboard menu navigation, so i think it should be intuitive.

Would be nice to see mine in the next public release. :)

Tested in Safari, Firefox 3, IE7: works ;)

Thank you.
Stanislav

Comments

sun’s picture

Title: Einable keyboard navigation » Add support for keyboard navigation
Component: User interface » Code
Priority: Critical » Normal
Status: Reviewed & tested by the community » Needs review

Nice idea.

A potential issue with the ESC-key is that some browsers could understand pressing it as a command to a reset form values of a focused form.

sun’s picture

Status: Needs review » Needs work
StatusFileSize
new5.22 KB

First of all: Code clean-up. ;)

This indeed works pretty nice. However, the code needs much more inline documentation, because I have no idea why and how those variables are shuffled around.

Additionally, why do we have to use two private functions?

Please try hard to simplify and document this code. Based on the code (and no real benchmarks) I would say this is a performance-killer currently.

lifedraft’s picture

Status: Needs work » Needs review
StatusFileSize
new7.93 KB

Hi,

it looks like code is fully documented now and private functions are kicked.

You have mentioned that two recursive loops are performance killers. They look wild, but they don't. Benchmarks of the loops equal to benchmarks of current release initialization code. ;)
I've done some performance tests and rewrapped the initialization procedure,
this will be now invoked during first menu activation.

> A potential issue with the ESC-key is that some browsers could understand pressing
> it as a command to a reset form values of a focused form.

Idea for another activation key?

Please take a look :)
Thank you.

Stanislav

deciphered’s picture

Hi Stanislav,

I've implemented this patch into the patch at #226012: Merge Administration Menu Dropdown module with a few (very) minor changes.

I've been testing the keyboard navigation functionality and I have a few things I've noticed:

- The order of my menu is "[druplicon], Content management, Site building, Site configuration, User management, Reports, Help, [users], Log out" but the order of navigation is "[druplicon], Log out, Content management, Site building, Site configuration, User management, Reports"

- Items without sub-items (Help & [users]) aren't selectable.

- Pushing up at the top of a menu will loop to the bottom of the menu, but pushing down at the bottom of the menu won't loop to the top.

- There is no identifier of which item is selected other than the default browser outlining of an active link.
- Looking at the code I noticed there was actually a css class for selected items, but css code was not included in the patch.
- When adding the css class into the code manually I noticed that when traversing to a sub-menu, the parent items weren't maintaining the css class.

I think that's all I've noticed so far, will be sure to post more if I find it.
As for the issue with the ESC key, I would suggest making the key/combo definable as is the Key Combo behavior of Admin Menu Dropdown.
If my patch is approved or green lighted for further development it shouldn't be to difficult to do.

Cheers,
Deciphered.

lifedraft’s picture

StatusFileSize
new11.46 KB

Hi Deciphered,

I've fixed issues you noticed.
We have got new key/combo this is: SHIFT+SPACE (The same combo as browser's scroll to top)

There are some very minor changes in the admin_menu.inc, needed to get right keyboard order during the keyboard navigation.

This patch goes on top of the current admin_menu dev release: 6.x-1.x-dev

Best,
Stanislav

sun’s picture

Version: 6.x-1.x-dev » 6.x-3.x-dev
sun’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

Status: Needs review » Needs work

The last submitted patch, admin_menu.keyboard.patch, failed testing.

mrf’s picture

Status: Needs work » Needs review
StatusFileSize
new879 bytes

I use pentadactyl for keyboard based browsing and have been annoyed when admin menu menus do not open on focus.

Unlike the above patch which brings the extra overhead of custom keybindings, the following just allows standard tab / shift+tab based keyboard navigation to work within admin menu.

marcvangend’s picture

Since this post is now linked from #806350: Add a search widget to find links in admin menu, I would like to add:
I intuitively expected the search results dropdown to be navigatable with the arrow-down and arrow-up keys. Hope that can be added.

micnap’s picture

StatusFileSize
new94.61 KB

Patch in #9 applied cleanly in latest dev. I tested it in Chrome 25, FF 19, and IE 9 on Win7 and Chromium 25 and FF 19 on Ubuntu. Worked as intended. However, in IE9 and both browsers in Ubuntu, the menu items under the home icon wouldn't close as the other ones did after you left the last item for that section. Not sure if that's a problem or not. See attached.

frank ralf’s picture

Just for convenience showing your screenshot directly ;-)

Admin menu not closing

mgifford’s picture

@Frank Ralf any reason not to mark this RTBC. I'm not a JS guy, but looks pretty straightforward.

frank ralf’s picture

Status: Needs review » Reviewed & tested by the community

@mgifford
Me neither ;-) But you're right, that was really a thorough review.

mrf’s picture

Status: Reviewed & tested by the community » Needs work

RTBC also can stand for 'ready to be commited' and the reviewer pointed out some cross-browser issues that would ned to be resolved before this gets committed.

mgifford’s picture

This is really about putting in either ESC-key or SHIFT+SPACE to activate, right?

Other than the apple example, do we need some broader use case to consider? Also a challenge to make it discoverable for folks. It's great to have a shortcut, but folks need to know it's there.

honza pobořil’s picture

Issue summary: View changes

+1 for comment #10 - keyboard navigation in the search widget too

truls1502’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: +postponed2w

I am sorry for no reply until now.

There are many issues regarding this module admin_menu which is a bit difficult for us to follow up since some of the issues might be already outdated, or is already fixed by the module or any other modules or itself core which means that the problem might no longer need to be fixed.

We can see that the issue has been created for a few years ago, I hope it is okay for you that I am postponing the issue, and give you around two weeks. If you still face the problem, could you tell us the step by step when until you get the error message or what is frustrated you, and a list of modules you are using related to admin_menu and a screenshot that might help us? So it makes us easier to reproduce your issue.

However, after two weeks with no feedback - we will close this issue. So in case, you noticed it after the issue is closed, do not hesitate to reopen it like and fill information which is mentioned above.

So before giving us a feedback, do you mind to test it again with our latest 7.x-3.x-dev?

Thank you for understanding! :)

truls1502’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: -postponed2w

This issue has been automatically marked as closed because it has not had recent activity after the last post.

However, if you or someone is still facing the same issue as described to the issue, could you please to re-open the issue by changing the status of the issue, and add an explanation with more details which can help us to reproduce your situation.

Again, thank you for your contributions! :)