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

bugfix(DisabledContextProvider): fix disabled logic #38886

Merged
merged 2 commits into from Nov 23, 2022
Merged

bugfix(DisabledContextProvider): fix disabled logic #38886

merged 2 commits into from Nov 23, 2022

Conversation

lidianhao123
Copy link
Contributor

[中文版模板 / 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
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

When Form props disabled = true ConfigProvider componentDisabled = false no render correct
demo code

    <Form disabled={true}>
      <Form.Item label="form disabled=true componentDisabled=false bug">
        <ConfigProvider componentDisabled={false}>
        <Upload {...props}>
          <Button icon={<UploadOutlined />}>Click to Upload</Button>
        </Upload>
        </ConfigProvider>
      </Form.Item>
    </Form>

Error code

<DisabledContext.Provider value={disabled || originDisabled}>
      {children}
    </DisabledContext.Provider>

📝 Changelog

Language Changelog
🇺🇸 English Fix componentDisabled componentDisabled=false no correct
🇨🇳 Chinese 修复 ConfigProvider componentDisabled=false 失效问题

☑️ 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 Nov 23, 2022

@MadCcc
Copy link
Member

MadCcc commented Nov 23, 2022

来个测试用例

@lidianhao123
Copy link
Contributor Author

lidianhao123 commented Nov 23, 2022

来个测试用例

已补充测试用例,帮忙再Review

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (c3ee40d) compared to base (4288039).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##           4.x-stable    #38886   +/-   ##
============================================
  Coverage      100.00%   100.00%           
============================================
  Files             447       447           
  Lines            8323      8323           
  Branches         2534      2534           
============================================
  Hits             8323      8323           
Impacted Files Coverage Δ
components/config-provider/DisabledContext.tsx 100.00% <100.00%> (ø)

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MadCcc MadCcc merged commit 6f4b965 into ant-design:4.x-stable Nov 23, 2022
MadCcc pushed a commit that referenced this pull request Nov 23, 2022
* bugfix(DisabledContextProvider): fix disabled logic

* test: add test for ConfigProvider componentDisabled

Co-authored-by: dian.li <dian.li@yunzhanghu.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.

None yet

2 participants