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(FloatButtonGroup): Add onClick prop #40706

Open
wants to merge 6 commits into
base: feature
Choose a base branch
from

Conversation

Riyad-Arafat
Copy link
Contributor

@Riyad-Arafat Riyad-Arafat commented Feb 13, 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

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English fix: missing onClick in FloatButtonGroup
🇨🇳 Chinese 修复: FloatButtonGroup 遗漏 onClick

☑️ 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 Feb 13, 2023

Preview failed

@codecov
Copy link

codecov bot commented Feb 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (dee3901) to head (87135be).

❗ Current head 87135be differs from pull request most recent head b472f4a. Consider uploading reports for the commit b472f4a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           feature    #40706    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          739       708    -31     
  Lines        12688     12101   -587     
  Branches      3334      3207   -127     
==========================================
- Hits         12688     12101   -587     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MadCcc
Copy link
Member

MadCcc commented Feb 13, 2023

Any senario in real world needs this prop? Is onOpenChange enough?

@Riyad-Arafat
Copy link
Contributor Author

@MadCcc
The reason I added this prop is to enable the ability to update the open prop when clicking on the button. In some cases, this behavior may be required, and the onClick prop provides a convenient way to handle it.

@MadCcc
Copy link
Member

MadCcc commented Feb 13, 2023

@MadCcc The reason I added this prop is to enable the ability to update the open prop when clicking on the button. In some cases, this behavior may be required, and the onClick prop provides a convenient way to handle it.

In this case onOpenChange and trigger="click" is enough.

@Riyad-Arafat
Copy link
Contributor Author

@MadCcc The reason I added this prop is to enable the ability to update the open prop when clicking on the button. In some cases, this behavior may be required, and the onClick prop provides a convenient way to handle it.

In this case onOpenChange and trigger="click" is enough.

You're correct, but FloatButtonGroupProps extends FloatButtonProps. I became confused when I attempted to use it and it failed to work.

@Riyad-Arafat
Copy link
Contributor Author

Riyad-Arafat commented Feb 13, 2023

@MadCcc
In my case, I want the menu to remain open even when I click away from the button. I want the open state to be changed only when the float button is clicked.

@li-jia-nan
Copy link
Member

We worry it is easy to cause ambiguity, some people will think that the click of the FloatButtonGroup is the entire area, and some people will think it is the trigger button.

@Riyad-Arafat
Copy link
Contributor Author

We worry it is easy to cause ambiguity, some people will think that the click of the FloatButtonGroup is the entire area, and some people will think it is the trigger button.

Thank you for bringing up the concern about ambiguity. I agree that choosing a clear and meaningful name for the click area would be the best solution to avoid any confusion.
Do you have any suggestions for a more descriptive name that we could use instead?

Copy link

@AbdullahWins AbdullahWins left a comment

Choose a reason for hiding this comment

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

good job!

@afc163
Copy link
Member

afc163 commented Oct 23, 2023

Conflicting

Signed-off-by: Riyad Elberkawy <riyad.elberkawy@gmail.com>
Copy link

codesandbox-ci bot commented Dec 2, 2023

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 87135be:

Sandbox Source
antd reproduction template (forked) Configuration

@Riyad-Arafat
Copy link
Contributor Author

@afc163
resolved

Copy link
Contributor

github-actions bot commented Mar 22, 2024

👁 Visual Regression Report for PR #40706 Passed ✅

🎯 Target branch: feature (dee3901)
📖 View Full Report ↗︎

🎊 Congrats! No visual-regression diff found.

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

5 participants