Skip to content

Commit

Permalink
fix: Remove extra tab stop on XML group (#82)
Browse files Browse the repository at this point in the history
Ben's PR #72 removed the tabindex on the enclosing DIV, but there's
also a tabindex on the XML element that encloses the G that gets
the focus/blur event listeners.  Remove it.

An alternative approach would be to add the event listeners to the
XML element instead of the G element, and this might be preferable
overall but breaks the visual indicator that you have tabbed to the
workspace (and I don't know how to fix it) so I'm going with this
approach for now.
  • Loading branch information
cpcallen authored Oct 29, 2024
1 parent 25470db commit 3100903
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ export class KeyboardNavigation {
this.setGlowTheme();
installCursor(workspace.getMarkerManager());

// Ensure that only the root SVG group has a tab index.
// Ensure that only the root SVG G (group) has a tab index.
workspace.getInjectionDiv().removeAttribute('tabindex');
workspace.getParentSvg().removeAttribute('tabindex');

workspace.getSvgGroup().addEventListener('focus', () => {
navigationController.setHasFocus(true);
Expand Down

0 comments on commit 3100903

Please sign in to comment.