mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
terminal: exclude from keyboard tab focus
Since the terminal "steals" the tab key, we don't want to include it in the keyboard tab list. It is still mouse focusable and we will implement an landmark role for the terminal for assistive technologies.
This commit is contained in:
committed by
David Lechner
parent
b7a9c20cfe
commit
10079a4d14
@@ -113,9 +113,11 @@ const Terminal: React.FC = (_props) => {
|
||||
xterm.open(terminalRef.current);
|
||||
fitAddon.fit();
|
||||
|
||||
// HACK: remove tabindex from main xterm element, otherwise it takes
|
||||
// two tabs to get to the text area
|
||||
// HACK: remove terminal from keyboard tab focus
|
||||
// Since it steals tab key presses, there is no way
|
||||
// to get out of it, so we use landmark navigation instead.
|
||||
xterm.element?.removeAttribute('tabindex');
|
||||
xterm.textarea?.setAttribute('tabindex', '-1');
|
||||
|
||||
return () => xterm.dispose();
|
||||
}, [xterm]);
|
||||
|
||||
Reference in New Issue
Block a user