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

feat: add a focusTriggerAfterClose prop to Modal for passing down to rc-dialog #27985

Conversation

molokovev
Copy link
Contributor

@molokovev molokovev commented Nov 24, 2020

Also:

  • set default value to true, similarly to rc-dialog
  • add comments to the Modal docs. CN is google-translated though.

🤔 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
  • Other (about what?)

💡 Background and solution

I've faced an issue when after selecting something in a Modal I need to close it and to update a global state and then an input is supposed to reflect to redux action and being focused. But the antd's Modal focuses back the modal activating button after hide animation ends.
That's why this props would help. Actually, this prop can be set right now but without TS support though.

📝 Changelog

Language Changelog
🇺🇸 English focusTriggerAfterClose prop is added to Modal props type definitions
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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

View rendered components/modal/index.en-US.md
View rendered components/modal/index.zh-CN.md

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Nov 24, 2020

@afc163
Copy link
Member

afc163 commented Nov 24, 2020

feature branch

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 24, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3a0304f:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #27985 (3a0304f) into feature (d86c8c8) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           feature    #27985   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          392       392           
  Lines         7343      7344    +1     
  Branches      2044      2095   +51     
=========================================
+ Hits          7343      7344    +1     
Impacted Files Coverage Δ
components/modal/ConfirmDialog.tsx 100.00% <ø> (ø)
components/modal/Modal.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d86c8c8...3a0304f. Read the comment docs.

@molokovev
Copy link
Contributor Author

feature branch

@molokovev molokovev closed this Nov 26, 2020
@molokovev molokovev reopened this Nov 26, 2020
@molokovev molokovev changed the base branch from master to feature November 26, 2020 07:28
@molokovev
Copy link
Contributor Author

feature branch

Hi! Right, I wasn't sure if typings fix is either a bugfix or a feature. Thanks, fixed.

@afc163
Copy link
Member

afc163 commented Nov 26, 2020

Other commits is contained.

image

@zombieJ
Copy link
Member

zombieJ commented Nov 30, 2020

@molokovev PR contains other commit. Pls help to clean up.

- set default value to true, similarly to rc-dialog
- add comments to the Modal docs. CN is google-translated though.
@molokovev molokovev force-pushed the pr/add_missing_modal_focusTriggerAfterClose_prop_type branch from 26d4507 to 87e1132 Compare November 30, 2020 07:55
@molokovev
Copy link
Contributor Author

Removed other commits

From code review suggestions

Co-authored-by: 偏右 <afc163@gmail.com>
@afc163 afc163 changed the title Add a focusTriggerAfterClose prop to Modal for passing down to rc-dialog feat: add a focusTriggerAfterClose prop to Modal for passing down to rc-dialog Nov 30, 2020
@afc163 afc163 merged commit 1852e75 into ant-design:feature Nov 30, 2020
@afc163 afc163 mentioned this pull request Nov 30, 2020
19 tasks
@zombieJ zombieJ mentioned this pull request Nov 30, 2020
15 tasks
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.

4 participants