Skip to content

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

Merged
jelbourn merged 1 commit into
angular:masterfrom
crisbeto:overlay-reuse-position
Nov 20, 2017
Merged

feat(overlay): add option to re-use last preferred position when re-applying to open connected overlay#7805
jelbourn merged 1 commit into
angular:masterfrom
crisbeto:overlay-reuse-position

Conversation

@crisbeto

@crisbetocrisbeto commented Oct 15, 2017

Copy link
Copy Markdown
Member

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.

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

Copy link
Copy Markdown
Contributor

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

crisbeto commented Oct 21, 2017

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

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
crisbetoforce-pushed the overlay-reuse-position branch from f2a565b to 1a708e8CompareOctober 29, 2017 08:49
@crisbetocrisbeto changed the title fix(overlay): re-use last preferred position when re-applying to open connected overlayfeat(overlay): add option to re-use last preferred position when re-applying to open connected overlayOct 29, 2017
@crisbeto

Copy link
Copy Markdown
MemberAuthor

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

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jelbournjelbourn 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:masterNov 20, 2017
@angular-automatic-lock-bot

Copy link
Copy Markdown

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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 7, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@crisbeto@jelbourn@googlebot