Skip to content

Commit

Permalink
Ensure space between input and errors. Always trigger change and bloc…
Browse files Browse the repository at this point in the history
…k at the validation level
  • Loading branch information
garrettmflynn committed Nov 12, 2023
1 parent 6137938 commit 3e698e8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/renderer/src/stories/JSONSchemaInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,22 @@ export class JSONSchemaInput extends LitElement {
updated() {
const el = this.getElement();
if (el) {
if (this.validateEmptyValue || (el.value ?? el.checked) !== "") el.dispatchEvent(new Event("change"));
el.dispatchEvent(new Event("change"));
}
}

render() {
const { info } = this;

const input = this.#render();

return html`
${input}
<p class="guided--text-input-instructions">
${info.description
? html`<p class="guided--text-input-instructions">
${unsafeHTML(capitalize(info.description))}${info.description.slice(-1)[0] === "." ? "" : "."}
</p>`
? html`${unsafeHTML(capitalize(info.description))}${info.description.slice(-1)[0] === "." ? "" : "."}`
: ""}
</p>
`;
}

Expand Down

0 comments on commit 3e698e8

Please sign in to comment.