Skip to content

Commit

Permalink
fix(Minimap): remove focus on minimap, and focus back on view
Browse files Browse the repository at this point in the history
  • Loading branch information
gliegard authored and gchoqueux committed May 11, 2022
1 parent 88d7c93 commit e585b42
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Utils/gui/Minimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,10 @@ class Minimap extends Widget {
placement: layer.source.extent, // TODO : the default placement should be the view extent for ortho camera
noControls: true,
maxSubdivisionLevel: view.tileLayer.maxSubdivisionLevel,
disableFocusOnStart: true,
});
this.view.addLayer(layer); // TODO : should this promise be returned by constructor so that user can use it ?

// Give the focus back to the main view. Indeed, `View` constructor takes the focus, and we don't want the focus
// on the latest created `View`, which is the minimap view.
view.domElement.focus();
// Prevent the minimap domElement to get focus when clicked, and prevent click event to be propagated to the
// main view controls.
this.domElement.addEventListener('pointerdown', (event) => {
Expand Down

0 comments on commit e585b42

Please sign in to comment.