use data attr to get the document type key

This commit is contained in:
Mads Rasmussen
2023-03-14 13:26:17 +01:00
parent 78470a8529
commit dd4f6fc61b

View File

@@ -37,7 +37,8 @@ export class UmbAllowedDocumentTypesModalElement extends UmbModalBaseElement<
#onClick(event: PointerEvent) {
event.stopPropagation();
const target = event.target as HTMLButtonElement;
const documentTypeKey = target.value;
const documentTypeKey = target.dataset.key;
if (!documentTypeKey) throw new Error('No document type key found');
this.modalHandler?.submit({ documentTypeKey });
}