components icon indicating copy to clipboard operation
components copied to clipboard

cdkConnectedOverlay default positions don't have horizontal fallbacks

Open TishchenkoAlex opened this issue 9 years ago • 3 comments

Bug, feature request, or proposal:

feature request

What is the expected behavior?

cdkConnectedOverlay horizontal auto-alignment strategy not working (see demo-video below)

What is the current behavior?

cdkConnectedOverlay horizontal auto-alignment must works correct (like vertical )

What are the steps to reproduce?

https://youtu.be/RCH2HCqq-O0

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

ng 5.0.1, ts 2.4.2, material beta-12

Is there anything else we should know?

TishchenkoAlex avatar Nov 08 '17 21:11 TishchenkoAlex

I haven't used the directive yet, but I think you need to provide fallback positions via cdkConnectedOverlayPositions

https://github.com/angular/material2/blob/f08b3f0e1e97bc6d6e37b0def116bddd7796bce7/src/cdk/overlay/overlay-directives.ts#L108-L109

The default ones allow vertical repositioning, but don't account for horizontal needs

https://github.com/angular/material2/blob/f08b3f0e1e97bc6d6e37b0def116bddd7796bce7/src/cdk/overlay/overlay-directives.ts#L44-L52

@jelbourn would it be wise to add one or two fallback positions to the default list where the horizontal connection position is different?

willshowell avatar Nov 08 '17 22:11 willshowell

Would be a good default

jelbourn avatar Nov 08 '17 22:11 jelbourn

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.