Skip to content

Commit d91de1c

Browse files
committed
fix(ui-popover,ui-tooltip): tooltips should close when esc is pressed
1 parent 0c00612 commit d91de1c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/ui-popover/src/Popover/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class Popover extends Component<PopoverProps, PopoverState> {
181181
// manage its FocusRegion internally rather than registering it with
182182
// the FocusRegionManager via Dialog
183183
this._focusRegion = new FocusRegion(this._contentElement, {
184-
shouldCloseOnEscape: false,
184+
shouldCloseOnEscape: this.props.shouldCloseOnEscape,
185185
shouldCloseOnDocumentClick: false,
186186
onDismiss: this.hide
187187
})

packages/ui-tooltip/src/Tooltip/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class Tooltip extends Component<TooltipProps, TooltipState> {
175175
onBlur={this.handleBlur}
176176
elementRef={this.handleRef}
177177
shouldCloseOnDocumentClick={false}
178+
shouldCloseOnEscape
178179
>
179180
<span id={this._id} css={styles?.tooltip} role="tooltip">
180181
{/* TODO: figure out how to add a ref to this */}

0 commit comments

Comments
 (0)