Skip to content

fix: click open / close preview button #1887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/js/search-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
hidePreview,
updateAutocompleteList,
AUTOCOMPLETE_CONTAINER_SELECTOR,
AUTOCOMPLETE_SUGGESTION_SELECTOR
AUTOCOMPLETE_SUGGESTION_LIST_SELECTOR
} from './autocomplete/autocomplete-list'
import { isMacOS, qs } from './helpers'

Expand Down Expand Up @@ -103,7 +103,7 @@ function addEventListeners () {
if (relatedTarget) {
// If blur is triggered caused by clicking on an autocomplete result,
// then ignore it, because it's handled in the click handler below.
if (relatedTarget.matches(AUTOCOMPLETE_SUGGESTION_SELECTOR)) {
if (qs(AUTOCOMPLETE_SUGGESTION_LIST_SELECTOR).contains(relatedTarget)) {
// Focus the input after a while, so that it's easier to close
// or get back to after an accidental blur
setTimeout(() => {
Expand Down

Large diffs are not rendered by default.