-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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(badge): add support for hint feature #30213
base: next
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> Icons inside badges don't have any specific styling. <!-- Please describe the behavior or changes that are being added by this PR. --> According to the design, for the ionic theme, the size of icons inside badges have specific values. To accommodate those: - Added new rules for the badge sizes - Adding a new testing page and screenshot tests - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: Brandy Smith <[email protected]>
...ton/test/basic/tab-button.e2e.ts-snapshots/tab-button-badge-ios-ltr-Mobile-Firefox-linux.png
Outdated
Show resolved
Hide resolved
core/src/components/badge/badge.tsx
Outdated
* | ||
* Defaults to `"static"`. | ||
*/ | ||
@Prop() position: 'top-right' | 'bottom-right' | 'static' = 'static'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the property name and values. Here are some of the other components for reference:
Component | Property | Options |
---|---|---|
ion-infinite-scroll |
position |
"bottom" | "top" |
ion-label |
position |
"fixed" | "floating" | "stacked" |
ion-toast |
position |
"bottom" | "middle" | "top" |
ion-fab |
horizontal |
"center" | "end" | "start" |
ion-fab |
vertical |
"bottom" | "center" | "top" |
Do we plan to eventually support a left
property? Maybe we should follow the approach used by ion-fab
and offer horizontal
and vertical
options instead? This is how MUI handles it: https://mui.com/material-ui/react-badge/#badge-alignment
Also, we should use end
instead of right
if it flips in RTL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not planned, but I thought this would scale better if that changes in the future. But I agree with you with the start/end stuff, will change that. Maybe will make it bottom | top, to make it similar to other components.
I think for this horizontal and vertical would be too much just for two positions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would static
stand for? Should this be described as well? Any reason we don't include top-left
and bottom-left
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original idea for static, was to stand for the actual css property used, position: static, as in no absolute position is being used.
But after @brandyscarney feedback I changed to just top and bottom. As for other positions, according to UX team only the right/end side makes sense for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My vote is to follow what fab
does with horizontal
and vertical
. It would stay consistent with what we have, leading for an easier introduction for the community.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there's also position in ion-infinite-scroll, ion-label and ion-toast. Personally, when I see horizontal or vertical props, I think about alignment, not absolute positioning 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandyscarney @thetaPC @christian-bromann do you all vote for the ion-fab approach and instead have a vertical
prop that accepts top | bottom
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the change 👍
...ton/test/basic/tab-button.e2e.ts-snapshots/tab-button-badge-ios-ltr-Mobile-Firefox-linux.png
Outdated
Show resolved
Hide resolved
Co-authored-by: Brandy Smith <[email protected]>
Issue number: internal
What is the new behavior?
Does this introduce a breaking change?
Other information