Skip to content

Commit

Permalink
Merge branch 'main' into source-data-merge-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored Jan 17, 2024
2 parents 5afe8f6 + 9826737 commit 254757e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/renderer/src/stories/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ export class Search extends LitElement {
const listItemElement = document.createElement("li");
listItemElement.classList.add("option");
listItemElement.setAttribute("hidden", "");
listItemElement.setAttribute("tabindex", -1);
if (option.keywords) listItemElement.setAttribute("data-keywords", JSON.stringify(option.keywords));
listItemElement.addEventListener("click", (ev) => {
ev.stopPropagation();
listItemElement.addEventListener("click", (clickEvent) => {
clickEvent.stopPropagation();
this.#onSelect(option);
});

Expand Down Expand Up @@ -393,18 +394,21 @@ export class Search extends LitElement {
<div class="header" style=${styleMap({
...this.headerStyles,
})}>
<input placeholder="Type here to search" value=${valueToDisplay} @click=${(ev) => {
ev.stopPropagation();
<input placeholder="Type here to search" value=${valueToDisplay} @click=${(clickEvent) => {
clickEvent.stopPropagation();
if (this.listMode === "click") {
const input = ev.target.value;
const input = clickEvent.target.value;
this.#populate(input);
}
}} @input=${(ev) => {
const input = ev.target.value;
}}
@input=${(inputEvent) => {
const input = inputEvent.target.value;
this.#populate(input);
}}
@blur=${(ev) => {
@blur=${(blurEvent) => {
if (blurEvent.relatedTarget.classList.contains("option")) return;
this.submit();
}}
Expand Down

0 comments on commit 254757e

Please sign in to comment.