Skip to content

Commit

Permalink
Merge pull request desktop#19106 from desktop/fix-clear-button-in-pre…
Browse files Browse the repository at this point in the history
…view-pull-request

Stop Popover from closing if mouse event is prevented
  • Loading branch information
tidy-dev committed Aug 14, 2024
2 parents c6543c8 + 036d074 commit cbb650a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/src/ui/lib/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export class Popover extends React.Component<IPopoverProps, IPopoverState> {
const { target } = event

if (
!event.defaultPrevented &&
ref !== null &&
ref.parentElement !== null &&
target instanceof Node &&
Expand All @@ -215,6 +216,7 @@ export class Popover extends React.Component<IPopoverProps, IPopoverState> {
const { target } = event

if (
!event.defaultPrevented &&
ref !== null &&
ref.parentElement !== null &&
target instanceof Node &&
Expand Down
4 changes: 3 additions & 1 deletion app/src/ui/lib/text-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ export class TextBox extends React.Component<ITextBoxProps, ITextBoxState> {
this.props.onSearchCleared?.()
}

private clearSearchText = () => {
private clearSearchText = (e: React.MouseEvent) => {
e.preventDefault()

if (this.inputElement === null) {
return
}
Expand Down

0 comments on commit cbb650a

Please sign in to comment.