1
0
Fork 0
mirror of synced 2024-10-01 17:47:46 +13:00

Budi 7481 initial form step binding drawer can crash (#11751)

* Type safety

* Clear localFiles is fieldState is cleared
This commit is contained in:
melohagan 2023-09-15 10:45:15 +01:00 committed by GitHub
parent fb30be6ce4
commit 7f43db09a6
2 changed files with 8 additions and 1 deletions

View file

@ -235,7 +235,7 @@
const baseExtensions = buildBaseExtensions() const baseExtensions = buildBaseExtensions()
editor = new EditorView({ editor = new EditorView({
doc: value, doc: value?.toString(),
extensions: buildExtensions(baseExtensions), extensions: buildExtensions(baseExtensions),
parent: textarea, parent: textarea,
}) })

View file

@ -17,6 +17,13 @@
let fieldApi let fieldApi
let localFiles = [] let localFiles = []
$: {
// If the field state is reset, clear the local files
if (!fieldState?.value?.length) {
localFiles = []
}
}
const { API, notificationStore, uploadStore } = getContext("sdk") const { API, notificationStore, uploadStore } = getContext("sdk")
const component = getContext("component") const component = getContext("component")