Tab is a conflicting keyboard shortcut in a text editor. It can either indent text or navigate to the next element.
From that I read online there is a few alternative solutions with no real consensus:
- Don't let user enter tab with setTabChangesFocus(true) and instead rely of them to just using spaces which is a bit more inconvenient, but at least the navigation inside the app is consistent. This is out of question for code editor but for a plain text editor, it is probably not an issue.
- Implement another shortcut for keyboard navigation, the shortcut must be documented and communicated to the Accessibility API. For the shortcut to use, I saw suggestions about using 'Escape' and 'Ctrl-Tab'. See https://handreichungen.bfit-bund.de/accessible-uie/1.0/eingabefeld_mehrzeilig.html#operation
- Have a global option to toggle the behavior of Tab between indentation and keyboard navigation. But the only reference I could find is in an old WAI-ARIA Best Practices document https://www.w3.org/TR/2009/WD-wai-aria-practices-20090224/#richtext