Skip to content

Commit

Permalink
fix(float-button): marginBottom is invalid after the href is added (a…
Browse files Browse the repository at this point in the history
…nt-design#44707)

* fix(float-button): marginBottom is invalid after the href is added

* chore: update demo

* chore: add annotation
  • Loading branch information
Yuiai01 authored Sep 8, 2023
1 parent 9a1fbad commit fa4c0c0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ Array [
class="ant-float-btn-group ant-float-btn-group-circle ant-float-btn-group-circle-shadow"
style="right: 94px;"
>
<button
<a
class="ant-float-btn ant-float-btn-default ant-float-btn-circle"
type="button"
href="https://ant.design/index-cn"
>
<span
class="ant-badge"
Expand Down Expand Up @@ -159,7 +159,7 @@ Array [
</div>
</div>
</div>
</button>
</a>
<button
class="ant-float-btn ant-float-btn-default ant-float-btn-circle"
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ Array [
class="ant-float-btn-group ant-float-btn-group-circle ant-float-btn-group-circle-shadow"
style="right:94px"
>
<button
<a
class="ant-float-btn ant-float-btn-default ant-float-btn-circle"
type="button"
href="https://ant.design/index-cn"
>
<span
class="ant-badge"
Expand Down Expand Up @@ -136,7 +136,7 @@ Array [
</bdi>
</sup>
</span>
</button>
</a>
<button
class="ant-float-btn ant-float-btn-default ant-float-btn-circle"
type="button"
Expand Down
6 changes: 5 additions & 1 deletion components/float-button/demo/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ const App: React.FC = () => (
<>
<FloatButton shape="circle" badge={{ dot: true }} style={{ right: 24 + 70 + 70 }} />
<FloatButton.Group shape="circle" style={{ right: 24 + 70 }}>
<FloatButton tooltip={<div>custom badge color</div>} badge={{ count: 5, color: 'blue' }} />
<FloatButton
href="https://ant.design/index-cn"
tooltip={<div>custom badge color</div>}
badge={{ count: 5, color: 'blue' }}
/>
<FloatButton badge={{ count: 5 }} />
</FloatButton.Group>
<FloatButton.Group shape="circle">
Expand Down
4 changes: 4 additions & 0 deletions components/float-button/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ const sharedFloatButtonStyle: GenerateStyle<FloatButtonToken, CSSObject> = (toke
position: 'fixed',
cursor: 'pointer',
zIndex: 99,
// Do not remove the 'display: block' here.
// Deleting it will cause marginBottom to become ineffective.
// Ref: https://github.com/ant-design/ant-design/issues/44700
display: 'block',
width: floatButtonSize,
height: floatButtonSize,
insetInlineEnd: token.floatButtonInsetInlineEnd,
Expand Down

0 comments on commit fa4c0c0

Please sign in to comment.