fix(overlays): hideOnEsc should also work while being on the invoker
This commit is contained in:
parent
2853444de7
commit
c899cf26d2
3 changed files with 4 additions and 0 deletions
|
|
@ -262,6 +262,7 @@ export class LionInputDatepicker extends OverlayMixin(LionInputDate) {
|
|||
_defineOverlayConfig() {
|
||||
return {
|
||||
...withModalDialogConfig(),
|
||||
hidesOnOutsideClick: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -483,8 +483,10 @@ export class OverlayController {
|
|||
if (phase === 'show') {
|
||||
this.__escKeyHandler = ev => ev.key === 'Escape' && this.hide();
|
||||
this.contentNode.addEventListener('keyup', this.__escKeyHandler);
|
||||
this.invokerNode.addEventListener('keyup', this.__escKeyHandler);
|
||||
} else if (phase === 'hide') {
|
||||
this.contentNode.removeEventListener('keyup', this.__escKeyHandler);
|
||||
this.invokerNode.removeEventListener('keyup', this.__escKeyHandler);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export class LionTooltip extends OverlayMixin(LitElement) {
|
|||
return {
|
||||
placementMode: 'local', // have to set a default
|
||||
elementToFocusAfterHide: null,
|
||||
hidesOnEsc: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue