-
-
Notifications
You must be signed in to change notification settings - Fork 425
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: make tooltips stay open #1383
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis update enhances tooltip functionality by introducing control over the open state of tooltips, enabling them to be permanently open or closed. The changes include new examples in the UI documentation and adjustments to the tooltip components to support this feature. Changes
Possibly related issues
Poem
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (3)
Files skipped from review due to trivial changes (1)
Additional comments not posted (6)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
it seems like ur branch base HEAD is way out of date, leading to massive conflicts. Please sync ur fork with latest |
e448f51
to
d3987e2
Compare
Yeah. I just noticed it yesterday. I was using my outdated main (on my personal repo) instead of upstream main. Just fixed it! |
const [open, setOpen] = useState(false); | ||
const [innerOpen, setOpen] = useState(false); | ||
|
||
const open = useMemo(() => { |
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.
no need to use useMemo()
here since its not a heavy calculation or any iteration, we can just stick to a more simplified version:
const [_open, setOpen] = useState(false);
const open = isOpen ?? _open;
Hey,
I'm pretending to be more active again giving contributions to flow-bite. It has some time from my last contributions so I'm feeling a little ankward about the standards of this project lol
Just picked up #1257 and gave it a shot. To summarize, I'm adding the possibility to override the open/closed status for tooltips:
I implemented it in a simple way, just added a new prop called "isOpen" that overrides the "open" state - now called innerOpen. Since he also wanted to change it's trigger, I made it's default to "null" and did a simple check to ensure that it would work as expected when true or false.
Tbh idk if it's a valid way to do it here at flow-bite so let's discuss about it. :)
Cheers,
Summary by CodeRabbit
New Features
isOpen
property for the Floating and Tooltip components to control their visibility state.Documentation