Skip to content

Commit

Permalink
Fix other focus issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmooney committed Jul 19, 2024
1 parent 99fbdcf commit d71b4e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions packages/base/src/panelview/components/layers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,22 @@ export class LayersPanel extends Panel {
nodeId,
event
}: LayersPanel.IClickHandlerParams) => {
if (!this._model) {
if (!this._model || !nodeId) {
return;
}

const { jGISModel } = this._model;
const selectedValue = jGISModel?.localState?.selected?.value;
const node = document.getElementById(nodeId);

(event.target as HTMLElement).tabIndex = 0;
(event.target as HTMLElement).focus();
if (!node) {
return;
}
// (event.target as HTMLElement).tabIndex = 0;
// (event.target as HTMLElement).focus();

node.tabIndex = 0;
node.focus();

// Early return if no selection exists
if (!selectedValue) {
Expand Down
2 changes: 1 addition & 1 deletion packages/base/style/leftPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
flex-grow: 1;
}

.jp-gis-layer:focus-within {
.jp-gis-layerText:focus {
outline: none;
}

Expand Down

0 comments on commit d71b4e8

Please sign in to comment.