mapbox-gl-draw
mapbox-gl-draw copied to clipboard
fix: Change how events.keydown checks classList for mapboxgl-canvas
Overview
- Originally
events.keydownonly checked the first value in theclassListto see that it matchesmapboxgl-canvas - Updated so that it checks the full
classListfor the valuemapboxgl-canvas- This enables usage with a classList that starts with
maplibregl-canvasfor instance
- This enables usage with a classList that starts with
- NOTE - Contains vs Includes
DOMTokenListonly supportscontains- In our tests we create synthetic events with an array for a classList which only supports
includes - Couldn't create a
DOMTokenListwithout creating an element so went with this approach