Components: feat(cdk/overlay): connected-overlay directive should have input for disabling escape close

Created on 22 May 2020  路  2Comments  路  Source: angular/components

Feature Description

Currently connected-overlay is hardcoded to be closed on escape. https://github.com/angular/components/blob/5f125395e0d39eb7e6a34d0c3355fc474f4d37a8/src/cdk/overlay/overlay-directives.ts#L287-L289
I propose adding a way to control this behavior.

Use Case

In my project I need an overlay that does not close on keyboard event. Also, if in the overlay we have a form, there may happen a situation when user should be forced to complete it before closing the overlay.

I create overlay in this manner:

  cdkConnectedOverlayHasBackdrop
  cdkConnectedOverlayBackdropClass="light-backdrop"
  [cdkConnectedOverlayOrigin]="origin"
  [cdkConnectedOverlayPositions]="positions"
  [cdkConnectedOverlayOpen]="isOpen"
  [cdkConnectedOverlayScrollStrategy]="scrollStrategy"
P4 cdoverlay feature

Most helpful comment

Any update on this feature, for us it's something crucial ...
We can contribute if you need any help ;)

All 2 comments

Any update on this feature, for us it's something crucial ...
We can contribute if you need any help ;)

@devversion Can you take a look if PR with this feature is good enough? #20585
It's not breaking change, just nice and necessary feature

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vitaly-t picture vitaly-t  路  3Comments

shlomiassaf picture shlomiassaf  路  3Comments

kara picture kara  路  3Comments

Hiblton picture Hiblton  路  3Comments

julianobrasil picture julianobrasil  路  3Comments