-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(react): popover caret is not hidden when caret prop is false #15232
fix(react): popover caret is not hidden when caret prop is false #15232
Conversation
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…aret-prop-is-false
…aret-prop-is-false
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.
Thanks for the PR, however I think this can be accomplished by simply adding more specificity to the scss, without needing to update anything else. The caret is already set to display:none by default, it just needs the specificity to only display when the parent --caret class is visible, and the code is already correctly setting that classname.
Hi @alisonjoseph! I made a little change on README since I contributed to docs in other PR. |
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.
Looks good! Thanks for the contribution 🥳
…aret-prop-is-false
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.
🔥 thank you for the contribution @kuri-sun
451ce65
…bon-design-system#15232) * fix(react): popover caret is not hidden when caret prop is false * fix(react): popover caret is not hidden when caret prop is false --------- Co-authored-by: Andrea N. Cardona <[email protected]>
Closes #15155
Popover caret is not hidden when caret prop is false.
Changelog
New
caret
prop to the PopoverContent component to make the caret HTML element visible/invisible.${prefix}--popover-caret-close
to the PopoverContent component only whencaret
istrue
.${prefix}--popover-caret-close
class.Changed
caret
in the PopoverContent component inPublicAPI-test.js.snap
for testing.Additional
Testing / Reviewing
(Cause)
Because
caret
prop does not get passed down to PopoverContent which contains the actual caret HTML element.The PopoverContent component needs to know whether
caret
prop istrue
orfalse
to make the caret HTML element visible/invisible.PopoverContent is used by Popover, DefinitionTooltip, and Tooltip components.
(Solution)
By adding
caret
prop to the PopoverContent component, the PopoverContent has control over the actual HTML element to be hidden/shown.