Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ConfirmDialog passing wrong footer prop #41173

Merged
merged 8 commits into from
Mar 11, 2023

Conversation

Svudec
Copy link
Contributor

@Svudec Svudec commented Mar 10, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

Fixes #41170

💡 Background and solution

<ConfirmDialog> component was passing an empty string as a footer prop to the <Dialog> component.

That was wrong as <Dialog> component is rendering that empty string in a <div> element wrapper that has a margin-top attribute as shown in the screenshot in the referenced issue.
<ConfirmDialog> should pass a null value for footer prop. That way a footer wrapper div won't be rendered.

BEFORE CHANGE:
image

AFTER CHANGE:
image

📝 Changelog

Language Changelog
🇺🇸 English [Modal] Fixed too large bottom margin when using confirm() to open a Modal
🇨🇳 Chinese [Modal] 修复使用 confirm() 打开 Modal 时下边距过大的问题

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2023

Copy link
Member

@Wxh16144 Wxh16144 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to supplement test cases Svudec#1

components/input-number/style/index.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 10, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (9893936) 100.00% compared to head (5afbb8f) 99.99%.

Additional details and impacted files
@@             Coverage Diff             @@
##            master   #41173      +/-   ##
===========================================
- Coverage   100.00%   99.99%   -0.01%     
===========================================
  Files          610      610              
  Lines        10488    10452      -36     
  Branches      2867     2849      -18     
===========================================
- Hits         10488    10451      -37     
- Misses           0        1       +1     
Impacted Files Coverage Δ
components/input-number/style/index.ts 100.00% <ø> (ø)
components/modal/ConfirmDialog.tsx 100.00% <ø> (ø)

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@afc163 afc163 merged commit 828305b into ant-design:master Mar 11, 2023
@zombieJ zombieJ mentioned this pull request Mar 13, 2023
16 tasks
RedJue pushed a commit to RedJue/ant-design that referenced this pull request Apr 4, 2023
* fix: ConfirmDialog passing wrong footer prop

* test: add case

* fix: fix modal accidental rendering of footer

* test: update snapshot

* Revert "style(InputNumber): Fixed font highlighting when disabled (ant-design#41167)"

This reverts commit 38b47f6.

* test: update snapshot

* Align components/input-number/style/index.ts with master

---------

Co-authored-by: Karlo Sudec <karlo.sudec@brainit.agency>
Co-authored-by: wuxh <wxh1220@gmail.com>
RedJue pushed a commit to RedJue/ant-design that referenced this pull request Apr 25, 2023
* fix: ConfirmDialog passing wrong footer prop

* test: add case

* fix: fix modal accidental rendering of footer

* test: update snapshot

* Revert "style(InputNumber): Fixed font highlighting when disabled (ant-design#41167)"

This reverts commit 38b47f6.

* test: update snapshot

* Align components/input-number/style/index.ts with master

---------

Co-authored-by: Karlo Sudec <karlo.sudec@brainit.agency>
Co-authored-by: wuxh <wxh1220@gmail.com>
RedJue pushed a commit to RedJue/ant-design that referenced this pull request Apr 25, 2023
* fix: ConfirmDialog passing wrong footer prop

* test: add case

* fix: fix modal accidental rendering of footer

* test: update snapshot

* Revert "style(InputNumber): Fixed font highlighting when disabled (ant-design#41167)"

This reverts commit 38b47f6.

* test: update snapshot

* Align components/input-number/style/index.ts with master

---------

Co-authored-by: Karlo Sudec <karlo.sudec@brainit.agency>
Co-authored-by: wuxh <wxh1220@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confirm Modal has an empty div below confirm buttons
4 participants