https://discord.umbraco.com logo
and in the parent component there is a save button...
# package-development
l
and in the parent component there is a save button:
Copy code
@customElement('my-sidepanel')
export class EditorSidePanelElement
  extends UmbElementMixin(LitElement)
  implements UmbModalExtensionElement<EditorSidePanelData, Field>
{
  readonly validation = new UmbValidationContext(this)

  async _handleSave() {
    await this.validation!.validate()
    const isValid = this.validation!.isValid // is always true
  }

render() {
    return html`
      <uui-dialog-layout>
        <div id="header"><h3>Edit</h3></div>
        <my-file-editor />
    <uui-button
        slot="actions"
        look="primary"
         color="secondary"
         label="Save"
         @click=${async () => await this._handleSave()}
         ></uui-button>
      </uui-dialog-layout>
  }
}
How can I make the child component (my-file-editor) invalidate the parent UmbValidationContext
3 Views