File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
src/BootstrapBlazor/Components/Upload Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 77 <BootstrapLabel required =" @Required" ShowLabelTooltip =" ShowLabelTooltip" Value =" @DisplayText" />
88}
99<div @attributes =" @AdditionalAttributes" class =" @ClassString" id =" @Id" >
10- <Button class =" @BrowserButtonClassString" IsDisabled =" @CheckStatus()" Size =" Size" Icon =" @BrowserButtonIcon" Text =" @BrowserButtonText" Color =" @BrowserButtonColor" >
10+ <Button class =" @BrowserButtonClassString" IsDisabled =" @CheckStatus()" Size =" Size" Icon =" @BrowserButtonIcon"
11+ Text =" @BrowserButtonText" Color =" @BrowserButtonColor" >
1112 @ChildContent
1213 </Button >
1314 @if (ShowUploadFileList )
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ protected async Task OnFileChange(InputFileChangeEventArgs args)
149149 fileCount = MaxFileCount . Value ;
150150
151151 // 计算剩余可上传数量
152- fileCount = fileCount - Files . Count ;
152+ fileCount -= Files . Count ;
153153 if ( fileCount <= 0 )
154154 {
155155 // 如果剩余可上传数量小于等于 0 则不允许继续上传
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public void ButtonUpload_IsDisabled_Ok()
8686 }
8787
8888 [ Fact ]
89- public void InputUpload_IsMultiple ( )
89+ public async Task InputUpload_IsMultiple ( )
9090 {
9191 var cut = Context . RenderComponent < ButtonUpload < string > > ( pb =>
9292 {
@@ -108,6 +108,13 @@ public void InputUpload_IsMultiple()
108108 var button = cut . Find ( ".btn-browser" ) ;
109109 Assert . True ( button . IsDisabled ( ) ) ;
110110
111+ // 调用 Reset 方法
112+ await cut . InvokeAsync ( ( ) => cut . Instance . Reset ( ) ) ;
113+
114+ // 重置后上传按钮应该被启用
115+ button = cut . Find ( ".btn-browser" ) ;
116+ Assert . False ( button . IsDisabled ( ) ) ;
117+
111118 // 开启多选功能
112119 cut . SetParametersAndRender ( pb =>
113120 {
You can’t perform that action at this time.
0 commit comments