Skip to content

Commit

Permalink
Markdown: fix ImageUploadChanged with multiple files (#5975)
Browse files Browse the repository at this point in the history
* Fixes issue of retrieving non-existent file.

* docs update
  • Loading branch information
tesar-tech authored Feb 19, 2025
1 parent bd5b05a commit 6549e9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@

<DocsPageSection>
<DocsPageSectionHeader Title="Upload image">
Uploading image has a similar API to our FileEdit component and it is fairly simple to do.
Uploading an image has a similar API to our <Code>FileEdit</Code> component and is fairly simple to use.
<Strong>Note that</Strong> the events related to file uploads fire separately for each file instead of grouping them.
This behavior comes from the underlying Easy Markdown Editor, which processes files individually.
</DocsPageSectionHeader>
<DocsPageSectionContent Outlined FullWidth>
<MarkdownUploadImageExample />
Expand Down
4 changes: 3 additions & 1 deletion Source/Extensions/Blazorise.Markdown/wwwroot/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export function initialize(dotNetObjectRef, element, elementId, options) {
imageUploadNotifier.onError = onError;

// Reduce to purely serializable data, plus build an index by ID
element._blazorFilesById = {};
if (element._blazorFilesById == null) {
element._blazorFilesById = {};
}

var fileEntry = {
id: ++nextFileId,
Expand Down

0 comments on commit 6549e9a

Please sign in to comment.