Skip to content

Commit

Permalink
Properly set input
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed Nov 21, 2023
1 parent 893bda6 commit 5c7a24d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/renderer/src/stories/JSONSchemaInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ export class JSONSchemaInput extends LitElement {
// onValidate = () => {}

updateData(value, forceValidate = false) {

if (this.value !== value && !forceValidate) {

// Update the actual input element
const el = this.getElement();
if (el.type === "checkbox") el.checked = value;
else if (el.classList.contains("list"))
Expand All @@ -121,7 +124,8 @@ export class JSONSchemaInput extends LitElement {
return { value };
})
: [];
else el.value = value;
else if (el instanceof Search) el.shadowRoot.querySelector("input").value = value;
else el.value = value
}

const { path: fullPath } = this;
Expand Down Expand Up @@ -157,6 +161,7 @@ export class JSONSchemaInput extends LitElement {
this.value = value; // Update the latest value

this.#activateTimeoutValidation(name, path);

};

#triggerValidation = (name, path) => {
Expand Down
7 changes: 1 addition & 6 deletions src/renderer/src/stories/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ export class Search extends LitElement {
options: { type: Object },
showAllWhenEmpty: { type: Boolean },
listMode: { type: String, reflect: true },
value: { type: String, reflect: true },
};
}

Expand All @@ -187,6 +186,7 @@ export class Search extends LitElement {
});

this.#initialize();

}

onSelect = (id, value) => {};
Expand Down Expand Up @@ -220,11 +220,6 @@ export class Search extends LitElement {
#sortedCategories = [];

#populate = (input) => {
// Hide all if empty
if (!input) {
this.#initialize();
return;
}

const toShow = [];

Expand Down

0 comments on commit 5c7a24d

Please sign in to comment.