Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(overlay): add option to re-use last preferred position when re-applying to open connected overlay #7805

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Oct 15, 2017

Currently when updating the position of an open connected overlay (e.g. when the user is scrolling) we go through the same process for determining the preferred position as when the overlay was attached. This means that the preferred position could change, causing the overlay to jump. With these changes the consumer can decide to lock an overlay into its initial position, preventing it from jumping.

This PR is a resubmit of #5471.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 15, 2017
@jelbourn
Copy link
Member

I'm not sure about this- I've always considered it a feature that overlays can flip positions to stay on-screen when scrolling
(I even showed it off during my AngularMix talk)

What's your reasoning for wanting to change it?

@crisbeto
Copy link
Member Author

crisbeto commented Oct 21, 2017

My reasoning was that it could be distracting having the overlay "follow you" after you've decided to scroll away from it. Alternatively we can make this functionality opt-in and only enable it on the components where we think it makes sense (e.g. the select doesn't handle the repositioning very well because it also has to change the offsetY and the scroll position).

@jelbourn
Copy link
Member

I'd be okay with it being a setting. Not sure on the name, though.

…pplying to open connected overlay

Currently when updating the position of an open connected overlay (e.g. when the user is scrolling) we go through the same process for determining the preferred position as when the overlay was attached. This means that the preferred position could change, causing the overlay to jump. With these changes the consumer can decide to lock an overlay into its initial position, preventing it from jumping.

This PR is a resubmit of angular#5471.
@crisbeto crisbeto force-pushed the overlay-reuse-position branch from f2a565b to 1a708e8 Compare October 29, 2017 08:49
@crisbeto crisbeto requested a review from jelbourn as a code owner October 29, 2017 08:49
@crisbeto crisbeto changed the title fix(overlay): re-use last preferred position when re-applying to open connected overlay feat(overlay): add option to re-use last preferred position when re-applying to open connected overlay Oct 29, 2017
@crisbeto
Copy link
Member Author

@jelbourn I've reworked it to make the functionality opt-in.

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 pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Nov 13, 2017
@jelbourn jelbourn merged commit f83beb8 into angular:master Nov 20, 2017
@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 Sep 7, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants