Event target type casting

This commit is contained in:
leekelleher
2024-05-13 18:32:01 +01:00
parent 739d070d20
commit 753dad8d9f
2 changed files with 4 additions and 6 deletions

View File

@@ -83,10 +83,8 @@ export class UmbDocumentTypeWorkspaceViewStructureElement extends UmbLitElement
<umb-input-document-type
.documentTypesOnly=${true}
.selection=${this._allowedContentTypeUniques ?? []}
@change="${(e: CustomEvent) => {
const sortedContentTypesList: Array<UmbContentTypeSortModel> = (
e.target as UmbInputDocumentTypeElement
).selection.map((id, index) => ({
@change="${(e: CustomEvent & { target: UmbInputDocumentTypeElement }) => {
const sortedContentTypesList: Array<UmbContentTypeSortModel> = e.target.selection.map((id, index) => ({
contentType: { unique: id },
sortOrder: index,
}));

View File

@@ -27,8 +27,8 @@ export class UmbPropertyEditorUIMarkdownEditorElement extends UmbLitElement impl
this._overlaySize = config?.getValueByAlias('overlaySize') ?? undefined;
}
#onChange(e: Event) {
this.value = (e.target as UmbInputMarkdownElement).value as string;
#onChange(event: Event & { target: UmbInputMarkdownElement }) {
this.value = event.target.value as string;
this.dispatchEvent(new UmbPropertyValueChangeEvent());
}