don't block escape; fixes #1607 (#1661)

This commit is contained in:
Cory LaViska
2023-10-18 13:42:37 -04:00
committed by GitHub
parent afe7778f89
commit a5404ecab0
2 changed files with 2 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti
## Next
- Added the Croatian translation [#1656]
- Fixed a bug that caused the [[Escape]] key to stop propagating when tooltips are disabled [#1607]
## 2.10.0

View File

@@ -145,7 +145,7 @@ export default class SlTooltip extends ShoelaceElement {
private handleKeyDown = (event: KeyboardEvent) => {
// Pressing escape when the target element has focus should dismiss the tooltip
if (this.open && event.key === 'Escape') {
if (this.open && !this.disabled && event.key === 'Escape') {
event.stopPropagation();
this.hide();
}