fsq-studio-sdk-examples icon indicating copy to clipboard operation
fsq-studio-sdk-examples copied to clipboard

Prevent map move on "keydown"

Open svetoslavmishev opened this issue 1 year ago • 1 comments

Unable to prevent map move, when press keyboard arrow keys.

  1. Click on the map
  2. Press keyboard arrow keys (left, right, up or down)

How can I prevent this map movement, but keep dragpan behavior?

svetoslavmishev avatar Feb 22 '24 12:02 svetoslavmishev

Under the hood, there's a deck.gl instance that appends <div> with id="default-deckgl-overlay-wrapper" that has keyup and keydown handlers that actually handle navigation via arrow keys, and removing those event listeners achieves what you're looking for. However, that is wrapped in a Shadow DOM component that doesn't let you interact with its content directly. We could try exposing toggles for this so that you could configure the behavior more granularly.

abstractalgo avatar Feb 22 '24 13:02 abstractalgo