Skip to content

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

Closed

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.

Activity

  1. added
    feature
    needs triage
    on Oct 25, 2021
  2. added
    P3
    and removed
    needs triage
    on Oct 26, 2021
  3. self-assigned this
    on Oct 26, 2021
  4. added a commit that references this issue on Oct 26, 2021
    ddc3d1d
  5. added a commit that references this issue on Jan 13, 2022
    21fca4e
  6. added a commit that references this issue on Jan 13, 2022
    e6359cd
  7. angular-automatic-lock-bot commented on Feb 13, 2022

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Feb 13, 2022
  9. added a commit that references this issue on Apr 3, 2022
    440b51f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions