Accessibility: Improve Keyboard operations in editor (spellcheck popups, etc)

Mod Edit: split a FR in two.

2 Likes

Steps to reproduce

  1. context menu key (or shift + f10) while text cursor hovering appropriate link item such as a local attachment
  2. up or down with context menu open
  3. various attempts at resolving the context popup without a mouse, ideally by selecting an option rather than aborting
    3a. enter (nothing highlighted)
    3b. esc (known issue)
    3c. navigating focus away from note
    3d. closing all notes

Expected result

  • keyboard control ought to apply to context menu rather than note context until pop-up is resolved via an option being selected or aborting.
  • up and down ought to shift the highlighted item
  • enter ought to activate the highlighted selection
  • esc ought to close the popup (known issue)
  • context menu ought to abort if the note loses focus (minor)

Actual result

  • context menu key succeeds in opening pop-up
  • pop-up completely transparent to keyboard-driven operation
  • pop-up survives loss of context focus or context being closed completely (minor)

Environment

OS Name: Microsoft Windows 10 Home
OS Version: 10.0.19041 N/A Build 19041
Obsidian Version: v0.11.0

Additional information

known related issue
demo
1 Like

Spell checking in notes is very valuable to me, as is my ability to take notes quickly. For this reason it’s very important that I’m able to access the spelling suggestions on with the keyboard. The I find the interruption of having to use the mouse is very disruptive.

It seem that the OS native context menu has been introduced in v0.12.10 however there are still some bugs with the implementation that make it impossible to use the spell checking feature with only the keyboard.

  • esc key doesn’t dismiss the context menu.
  • when opened with the keyboard, the positioning of the context menu seem to be erratically offset from the caret.
  • when opened with the keyboard, the context menu does not include spelling suggestions for the current word.

Steps to reproduce

  • With the spellchecking feature enabled, navigate the caret to an incorrectly spelled word.
  • Invoke the context menu with the Keyboard (not sure if there’s a way to open/accept spelling suggestions on a mac with only the keyboard?)
  • Notice the menu appears offset from the caret (this may not always happen, it seems that this becomes more severe after editing text)
  • Notice that the menu does not contain relevant spelling corrections
  • Press ESC
  • Notice that the context menu remains visible

Expected result

  • The context menu should appear under the current caret position
  • The context menu should contain relevant spelling suggestions
  • The context menu should close when ESC is pressed

Actual result

  • The context menu appears erratically offset from the current caret position
  • The context menu contains not relevant spelling suggestions
  • The context menu remains open when ESC is pressed

Environment

  • Operating system:
    Windows 10 x64
  • Obsidian version:
    v0.12.10

Additional information

Apparently Command+Shift+: should open the spelling suggestions on a mac - maybe it’s worth checking this works too.

I’ve just written a quick plugin to work around this for now. GitHub - zapthedingbat/obsidian-keyboard-context-menu-fix-plugin: Obsidian plugin that fixes keyboard navigation of editor context menu.

1 Like

Steps to reproduce

Multiple issues with context menu (aka right click menu)

1. Keyboards controls are not working

Usually with context menus you can do next thing with a keyboard:

  • Press Esc to close it
  • Press Up/Down to navigate menu items
    • If press Up key on first item - it goin to back to last on
    • If press Down key on last item - it goin to back to first on
  • Press Space or Enter engage choose action

2. Keyboard is not get trapped on context menu.

In menus like this usually keyboard get’s “trapped” in a menu.
That mean that when Context Menu is opened so keyboard can manipulate Only in menu, but Not a cursor in editor.
Currently you can open Context menu and freely move cursor around in the document
image

Nice article here about how it should work here: What are keyboard traps? | Nomensa

3. There is few different Context Menus:

  • Right Mouse Click on Any word (that is pass spellcheck)
    image
  • Right Mouse Click on Any word that misspelled
    image
  • Right Mouse Click on selected part of the word
    image
  • Click Button Menu on the Keyboard on word (that is pass spellcheck)
    image
  • Click Button Menu on the Keyboard on word that misspelled
    image
  • Click Button Menu on the Keyboard on selected part of the word
    image

Bugs here:

  • All menus open by keyboard have only basic actions like Copy/cut/paste
  • missing any additional actions like: Collaborations, Extract current selection
  • Clicking on Not misspell word missing action Collaborations

Environment

  • Operating system: Windows 10
  • Obsidian version: v0.12.10

Additional information

There is may be more thing to it. I don’t know all states/actions that should be in Context menu.
Also It may need additional key binding for Vim mode (like j/k for Up/Down

Thank you, I’ve been looking for a solution even if it’s just a workaround - How can I install your plugin? Cannot seem to find it in the community plugins.

Edit: I have followed these steps to manually install the plugin, in case anyone else is also wondering. But will you be considering adding your plugin to the community plugin list?
Ps. the plugin works great, exactly what I was looking for.

I’ve just opened a Pull Request to add the plugin to the community plugin list Add keyboard context menu fix plugin by zapthedingbat · Pull Request #379 · obsidianmd/obsidian-releases · GitHub

2 Likes

Thanks for putting that up! Excited to start using this.

Looks like this probably wont get merged into the community plugins list. But the good news is that’s because it should be fixed in future releases. ( see the thread here Add keyboard context menu fix plugin by zapthedingbat · Pull Request #379 · obsidianmd/obsidian-releases · GitHub )

As like @brickorblock mentioned, if you want to start using this plugin now as an intermediate solution follow these steps to install manually GitHub - obsidianmd/obsidian-sample-plugin

This is implemented in 0.12.12

We are aware that sometimes Shift-F10 doesn’t trigger at the right spot.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.