Skip to content

Commit

Permalink
fix(dialog): fix dialog header is null or no,the close-button is not …
Browse files Browse the repository at this point in the history
…in the upper right corner (#2593)

* fix(dialog): fix dialog header is null or no,the close-button is not in the upper right corner

* test: update test snap

---------

Co-authored-by: Heising <[email protected]>
  • Loading branch information
HaixingOoO and Heising authored Nov 15, 2023
1 parent 08bc0ae commit c9cff1b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/dialog/DialogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ const DialogCard = forwardRef<HTMLDivElement, DialogCardProps>((props, ref) => {
return (
<span
className={`${componentCls}__close`}
style={{
marginLeft: 'auto',
}}
onClick={(e: React.MouseEvent<HTMLDivElement>) => onCloseBtnClick?.({ e })}
>
{closeIcon()}
Expand Down
12 changes: 12 additions & 0 deletions test/snap/__snapshots__/csr.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65895,6 +65895,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -65969,6 +65970,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66043,6 +66045,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66117,6 +66120,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66191,6 +66195,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66261,6 +66266,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66335,6 +66341,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66409,6 +66416,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66483,6 +66491,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -66557,6 +66566,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -83596,6 +83606,7 @@ exports[`csr snapshot test > csr test src/dialog/_example/modal.jsx 1`] = `
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down Expand Up @@ -83692,6 +83703,7 @@ exports[`csr snapshot test > csr test src/dialog/_example/modal.jsx 1`] = `
</div>
<span
class="t-dialog__close"
style="margin-left: auto;"
>
<svg
class="t-icon t-icon-close"
Expand Down
Loading

0 comments on commit c9cff1b

Please sign in to comment.