Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion library/src/plugins/attributes/bind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export const Bind: AttributePlugin = {
}
break
case 'file': {
const syncSignal = () => {
const syncSignal = (evt: Event) => {
const target = evt.target
if ('detail' in evt || target === null) return
evt.stopImmediatePropagation()
const files = [...(el.files || [])]
const contents: string[] = []
const mimes: string[] = []
Expand Down Expand Up @@ -119,6 +122,7 @@ export const Bind: AttributePlugin = {
},
),
)
target.dispatchEvent(new CustomEvent(evt.type, {detail: true}))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe this should go in a finally so the event doesn't get swallowed in case there is an error reading the files.

})
}

Expand Down