Skip to content

feat(google-maps): No way to prevent keyboard focus from going to Info Windows #23829

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

Closed
AiyazN25 opened this issue Oct 25, 2021 · 1 comment · Fixed by #23831
Closed

feat(google-maps): No way to prevent keyboard focus from going to Info Windows #23829

AiyazN25 opened this issue Oct 25, 2021 · 1 comment · Fixed by #23831
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@AiyazN25
Copy link

Feature Description

In the Google Maps API, you can prevent the keyboard focus being grabbed by the Info Windows, when they open, by doing something like:

infowindow.open({
      anchor: marker,
      map,
      shouldFocus: false,
    });

as shown in the example here: https://developers.google.com/maps/documentation/javascript/infowindows#open , i.e: set shouldFocus to false on the InfoWindowOpenOptions object. But there is no way to do this in the angular/google-maps package. In the package, the wrapper component https://github.com/angular/components/blob/master/src/google-maps/map-info-window/map-info-window.ts , has an open method, which only accepts MapAnchorPoint as its argument type - it doesn't support accepting InfoWindowOpenOptions type. Notice that if you access the underlying google.maps.InfoWindow directly in the wrapper, its open method signature is
open(map?: Map | StreetViewPanorama, anchor?: MVCObject): void;
so it also does not support accepting InfoWindowOpenOptions as its argument type. Consequently there is no way to prevent keyboard focus from going to Info Windows when they open.

The feature request here is to allow support for InfoWindowOpenOptions as an argument type in the open method, so that shouldFocus can be set to false.

Use Case

Currently facing an accessibility use case: we enter a value into a field, which triggers the map to re-render and its Info Windows to open. To meet an a11y acceptance criteria, the focus should remain on the field, rather than move to one of the Info Windows opened, so having this feature would enable us to meet the a11y criteria.

@AiyazN25 AiyazN25 added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Oct 25, 2021
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Oct 26, 2021
@crisbeto crisbeto self-assigned this Oct 26, 2021
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 26, 2021
Allows for the `shouldFocus` flag to be passed when opening the info window.

Fixes angular#23829.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 13, 2022
Allows for the `shouldFocus` flag to be passed when opening the info window.

Fixes angular#23829.
andrewseguin pushed a commit that referenced this issue Jan 13, 2022
…zed (#23831)

Allows for the `shouldFocus` flag to be passed when opening the info window.

Fixes #23829.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 13, 2022
forsti0506 pushed a commit to forsti0506/components that referenced this issue Apr 3, 2022
…zed (angular#23831)

Allows for the `shouldFocus` flag to be passed when opening the info window.

Fixes angular#23829.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants