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

feat(google-maps): allow for info window focus behavior to be customized #23831

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

crisbeto
Copy link
Member

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

Fixes #23829.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release labels Oct 26, 2021
@crisbeto crisbeto requested a review from jelbourn October 26, 2021 09:00
@crisbeto crisbeto requested a review from a team as a code owner October 26, 2021 09:00
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 26, 2021
@@ -168,7 +168,7 @@ export class MapInfoWindow implements OnInit, OnDestroy {
* Opens the MapInfoWindow using the provided anchor. If the anchor is not set,
* then the position property of the options input is used instead.
*/
open(anchor?: MapAnchorPoint) {
open(anchor?: MapAnchorPoint, shouldFocus?: boolean) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion: I'm wondering if we should pass these things through an object literal, making the API more readable when more options are added? I find it generally more clear like open({shouldFocus: false}), than open(undefined, false)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing it to an object literal would be a breaking change at this point. We could support both syntaxes for a while, but I don't think it's a big deal considering that there are only two parameters.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I also would prefer an object here (with backwards compat), but don't feel strongly enough to block the change

https://martinfowler.com/bliki/FlagArgument.html

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Oct 26, 2021
@josephperrott
Copy link
Member

@crisbeto After running a google3 presubmit, it looks like our internal version of the the Google Maps typings is out of date. The InfoWindow interface doesn't have the same API as our version here on Github.

@andrewseguin andrewseguin removed the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 26, 2021
@andrewseguin
Copy link
Contributor

@googlebot: rescan

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 26, 2021
@andrewseguin andrewseguin removed the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 28, 2021
Allows for the `shouldFocus` flag to be passed when opening the info window.

Fixes angular#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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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