Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Conversation

@RSLi
Copy link
Contributor

@RSLi RSLi commented Feb 2, 2017

Problem Addressed

For users dependent on tab navigation and screen readers (see this page), when they tab into ActiveCode's <textarea> the CodeMirror API changes tab function to indenting 4 spaces and there's no way to tab out of the <textarea> to change focus, basically prohibiting the user from further navigation.

Solution

After discussing with @jochenrick , we came up with the following idea that if the user uses tab navigation outside of ActiveCode, then we disable ActiveCode's tab indentation behavior so that when users hit tab inside ActiveCode the focus changes to the next HTML element as usual. If the user use mouse for navigation (such as clicking into ActiveCode), the ActiveCode will work normally by indenting 4 spaces when hitting tab.

Implementation

Within ActiveCode.js when keydown event is fired, if ActiveCode is not in focus, then we judge that the user is depending on tab navigation and change the ExtraKeys option of CodeMirror so that tab and shift-tab keys works normally.

Testing

I've tested the solution in Chrome, Firefox, Safari and demoed this to @jochenrick in person.

Contact

Siwei "Robert" Li

robertsiweili@gatech.edu

Georgia Institute of Technology

@bnmnetp bnmnetp merged commit 8db7fbc into RunestoneInteractive:master Jun 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants