Skip to content

Commit

Permalink
fix(module: upload): style with no button (#3734)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderJames committed Mar 18, 2024
1 parent a83ec40 commit 14f7100
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/upload/Upload.razor
Expand Up @@ -3,14 +3,14 @@

@using AntDesign.Internal;

<span style="@Style" @ref="Ref" class="@ClassMapper.Class @(IsPictureCard? "ant-upload-picture-card-wrapper" : "")"
<span style="@Style" @ref="Ref" class="@ClassMapper.Class"
@ondragover="@HandleDrag"
@ondragleave="@HandleDrag"
@ondrop="@HandleDrag"
@ondragover:stopPropagation
@ondragleave:stopPropagation
@ondrop:stopPropagation>
@if (!IsPictureCard || !ShowUploadList)
@if (ChildContent != null && (!IsPictureCard || !ShowUploadList))
{
<CascadingValue Value="this" IsFixed>
<UploadButton Action="@Action"
Expand Down
4 changes: 4 additions & 0 deletions components/upload/Upload.razor.cs
Expand Up @@ -103,6 +103,10 @@ protected override void OnInitialized()

var prefixCls = "ant-upload";

ClassMapper
.GetIf(() => $"{prefixCls}-picture-card-wrapper", () => IsPictureCard)
.GetIf(() => $"{prefixCls}-no-btn", () => ChildContent == null);

_listClassMapper
.Add($"{prefixCls}-list")
.Get(() => $"{prefixCls}-list-{ListType}")
Expand Down
10 changes: 8 additions & 2 deletions components/upload/style/patch.less
@@ -1,3 +1,9 @@
.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item {
float: unset;
@import './index.less';

.@{upload-prefix-cls}-list-rtl.@{upload-prefix-cls}-list-picture-card .@{upload-prefix-cls}-list-item {
float: unset;
}

.@{upload-prefix-cls}-no-btn .@{upload-prefix-cls}-list-item {
margin-top: 0;
}

0 comments on commit 14f7100

Please sign in to comment.