Skip to content

Commit

Permalink
fix(ui-popover,ui-tooltip): tooltips should close when esc is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
balzss committed Nov 22, 2024
1 parent 0c00612 commit d91de1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui-popover/src/Popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class Popover extends Component<PopoverProps, PopoverState> {
// manage its FocusRegion internally rather than registering it with
// the FocusRegionManager via Dialog
this._focusRegion = new FocusRegion(this._contentElement, {
shouldCloseOnEscape: false,
shouldCloseOnEscape: this.props.shouldCloseOnEscape,
shouldCloseOnDocumentClick: false,
onDismiss: this.hide
})
Expand Down
1 change: 1 addition & 0 deletions packages/ui-tooltip/src/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class Tooltip extends Component<TooltipProps, TooltipState> {
onBlur={this.handleBlur}
elementRef={this.handleRef}
shouldCloseOnDocumentClick={false}
shouldCloseOnEscape
>
<span id={this._id} css={styles?.tooltip} role="tooltip">
{/* TODO: figure out how to add a ref to this */}
Expand Down

0 comments on commit d91de1c

Please sign in to comment.