Skip to content

fix(material/slider) Update slider to use injected document #18275

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

Merged
merged 3 commits into from
Jan 27, 2020

Conversation

timsawyer
Copy link
Contributor

Update Angular Material slider component to inject reference
to document instead of accessing global variable. This allows for
rendering the slider in contexts where the document is dynamically
provided. This change follows the pattern used in Cdk OverlayContainer.

Update Angular Material `slider` component to inject reference
to document instead of accessing global variable. This allows for
rendering the slider in contexts where the document is dynamically
provided. This change follows the pattern used in Cdk OverlayContainer.
@timsawyer timsawyer requested a review from mmalerba as a code owner January 24, 2020 05:25
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 24, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

This probably won't do much, because there's some logic in the slider that depends on getBoundingClientRect which won't work on a stubbed-out document anyway.

@timsawyer
Copy link
Contributor Author

In the slider, getBoundingClientRect is called on _sliderWrapper.nativeElement, not the document, so this change would not affect that logic.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added G This is is related to a Google internal issue pr: lgtm target: patch This PR is targeted for the next patch release labels Jan 24, 2020
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

Overall looks good, just a couple comments

Move document injection to last parameter of constructor to
prevent causing API breaking changes. Also, fix minor
formatting issue on import statement.
@mmalerba
Copy link
Contributor

Looks good, just run this to update the API golden file:

bazel run //tools/public_api_guard:material/slider.d.ts_api.accept

Update slider API golden file to reflect document parameter
being added to the constructor
@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Jan 24, 2020
@jelbourn jelbourn merged commit 3bae800 into angular:master Jan 27, 2020
yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
Update Angular Material `slider` component to inject reference
to document instead of accessing global variable. This allows for
rendering the slider in contexts where the document is dynamically
provided. This change follows the pattern used in Cdk OverlayContainer.
jelbourn pushed a commit that referenced this pull request Feb 7, 2020
Update Angular Material `slider` component to inject reference
to document instead of accessing global variable. This allows for
rendering the slider in contexts where the document is dynamically
provided. This change follows the pattern used in Cdk OverlayContainer.

(cherry picked from commit 3bae800)
@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 27, 2020
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 cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants