Skip to content

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

Closed
@AiyazN25

Description

@AiyazN25

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.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions