Skip to content

Commit

Permalink
don't block escape; fixes #1607 (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska authored Oct 18, 2023
1 parent afe7778 commit a5404ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/pages/resources/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/components/tooltip/tooltip.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit a5404ec

Please sign in to comment.