mapbox-gl-draw icon indicating copy to clipboard operation
mapbox-gl-draw copied to clipboard

fix: Change how events.keydown checks classList for mapboxgl-canvas

Open thaddmt opened this issue 4 years ago • 0 comments

Overview

  • Originally events.keydown only checked the first value in the classList to see that it matches mapboxgl-canvas
  • Updated so that it checks the full classList for the value mapboxgl-canvas
    • This enables usage with a classList that starts with maplibregl-canvas for instance
  • NOTE - Contains vs Includes
    • DOMTokenList only supports contains
    • In our tests we create synthetic events with an array for a classList which only supports includes
    • Couldn't create a DOMTokenList without creating an element so went with this approach

thaddmt avatar Nov 05 '21 21:11 thaddmt