Budi 7481 initial form step binding drawer can crash (#11751)
* Type safety * Clear localFiles is fieldState is cleared
This commit is contained in:
parent
fb30be6ce4
commit
7f43db09a6
|
@ -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,
|
||||||
})
|
})
|
||||||
|
|
|
@ -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")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue