Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: listen for google maps key events on document, not map container #130

Closed
wants to merge 1 commit into from

Conversation

morehawes
Copy link
Contributor

Proposed fix for #129.

Google Maps was not picking up keyboard events ("keyup"/"keydown"). This change listens for keyboard events on the entire document, instead of the map container.

This means keyboard deletion is now working for Google Maps.

The only unintended consequence that I can think of is if there are multiple Terra Draw instances, both would respond to these events.

For example, in the development/ app if you have a Feature selected in Google Maps and then switch to another Map and select/delete a feature it will also pick up the keyboard event and delete it from the GM map also.

Google Maps was not picking up keyboard events ("keyup"/"keydown"). This change captures all keyboard events
@morehawes
Copy link
Contributor Author

My bad. The Jest testing environment is set to node so is squawking:

The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
    Consider using the "jsdom" test environment.

    ReferenceError: document is not defined

Further problems with the test expecting HTMLDivElement when I make that change, so instead of changing any tests I will pause on this for now.

@morehawes morehawes closed this Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant