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

fix(react): popover caret is not hidden when caret prop is false #15232

Merged
merged 6 commits into from
Dec 5, 2023
Merged

fix(react): popover caret is not hidden when caret prop is false #15232

merged 6 commits into from
Dec 5, 2023

Conversation

kuri-sun
Copy link
Contributor

Closes #15155

Popover caret is not hidden when caret prop is false.

Changelog

New

  • Added a new caret prop to the PopoverContent component to make the caret HTML element visible/invisible.
  • Added a new className ${prefix}--popover-caret-close to the PopoverContent component only when caret is true.
  • Added a new SCSS code for ${prefix}--popover-caret-close class.

Changed

  • Inserted a new prop type for caret in the PopoverContent component in PublicAPI-test.js.snap for testing.

Additional

  • in .all-contributorsrc file at line 1301, there is a curly brace forgotten. so added it.

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 is true or false 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.

popover-content-type

@kuri-sun kuri-sun requested review from a team as code owners November 20, 2023 23:42
Copy link

netlify bot commented Nov 20, 2023

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit c556762
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/656f3562295f75000842677c
😎 Deploy Preview https://deploy-preview-15232--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@alisonjoseph alisonjoseph left a 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.

Screenshot 2023-11-29 at 9 11 00 AM

@kuri-sun
Copy link
Contributor Author

kuri-sun commented Dec 3, 2023

Hi @alisonjoseph!
Thanks for the advice! I successfully made the change by just fixing the CSS! This way is so easy!
I will strive that I can contribute more and more 🧑‍🎄

I made a little change on README since I contributed to docs in other PR.

Copy link
Member

@alisonjoseph alisonjoseph left a 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 🥳

Copy link
Contributor

@andreancardona andreancardona left a 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

@github-actions github-actions bot enabled auto-merge December 5, 2023 14:39
@github-actions github-actions bot added this pull request to the merge queue Dec 5, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 5, 2023
@alisonjoseph alisonjoseph added this pull request to the merge queue Dec 5, 2023
Merged via the queue into carbon-design-system:main with commit 451ce65 Dec 5, 2023
21 checks passed
@kuri-sun kuri-sun deleted the fix/react/Popover-caret-is-not-hidden-when-caret-prop-is-false branch December 24, 2023 23:52
danoro96 pushed a commit to danoro96/carbon that referenced this pull request Jan 18, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Popover caret is not hidden when caret prop is false
3 participants