fix: FloatButtonGroup menu mode should support badge #44109
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
顺便优化了一下 dom 结构。原本没有 tooltip 和 badge 属性时也会套一层 Tooltip 或者 Badge,这不但会导致 dom 增加,还会引入不需要的样式。
📝 Changelog
badge
prop.badge
配置的问题。☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 5a28f5b
This pull request enhances the
FloatButtonGroup
andFloatButton
components with a newbadge
prop that allows displaying a badge on the floating buttons. It also refactors the components to improve their state management, performance, and accessibility. It adds a new test case and a new demo example to verify and showcase the new feature.🔍 Walkthrough
🤖 Generated by Copilot at 5a28f5b
FloatButton
component to conditionally renderTooltip
andBadge
components based ontooltip
andbadge
props (link)FloatButtonGroup
component to acceptfloatButtonProps
prop for passing additional props toFloatButton
children (link, link)FloatButtonGroup
component to usecustomOpen
prop derived fromopen
andtrigger
props for state management and consistency (link, link)group-menu.tsx
file to demonstratebadge
prop usage inFloatButtonGroup
component (link)group.test.tsx
file to verifybadge
prop rendering inFloatButton
component (link)