File tree Expand file tree Collapse file tree 3 files changed +17
-13
lines changed Expand file tree Collapse file tree 3 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 1- import type { FC } from 'react' ;
1+ import { useState , type FC } from 'react' ;
22import { Button , Tooltip } from '../../lib' ;
33import type { CodeExample } from './DemoPage' ;
44import { DemoPage } from './DemoPage' ;
55
6+ const ValidTsx = ( ) => {
7+ const [ state , setState ] = useState < boolean > ( false ) ;
8+
9+ return < div className = "flex gap-2" >
10+ < Tooltip isOpen placement = "bottom" content = "Always open" >
11+ < Button > Always open</ Button >
12+ </ Tooltip >
13+ < Tooltip isOpen = { state } placement = "bottom" content = "Always open" >
14+ < Button onClick = { ( ) => setState ( ( prev ) => ! prev ) } > Always closed</ Button >
15+ </ Tooltip >
16+ </ div >
17+ }
18+
619const TooltipsPage : FC = ( ) => {
720 const examples : CodeExample [ ] = [
821 {
@@ -60,16 +73,7 @@ const TooltipsPage: FC = () => {
6073 } ,
6174 {
6275 title : 'Stay open and stay closed tooltips' ,
63- code : (
64- < div className = "flex gap-2" >
65- < Tooltip isOpen placement = "bottom" content = "Always open" >
66- < Button > Always open</ Button >
67- </ Tooltip >
68- < Tooltip isOpen = { false } placement = "bottom" content = "Always open" >
69- < Button disabled > Always closed</ Button >
70- </ Tooltip >
71- </ div >
72- ) ,
76+ code : < ValidTsx /> ,
7377 } ,
7478 {
7579 title : 'Animation' ,
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export interface FloatingProps extends PropsWithChildren<Omit<ComponentProps<'di
4747 style ?: 'dark' | 'light' | 'auto' ;
4848 theme : FlowbiteFloatingTheme ;
4949 trigger ?: 'hover' | 'click' ;
50- isOpen ?: boolean ;
50+ isOpen ?: boolean | null ;
5151}
5252
5353/**
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export interface TooltipProps extends PropsWithChildren<Omit<ComponentProps<'div
1616 style ?: 'dark' | 'light' | 'auto' ;
1717 theme ?: DeepPartial < FlowbiteTooltipTheme > ;
1818 trigger ?: 'hover' | 'click' ;
19- isOpen ?: boolean ;
19+ isOpen ?: boolean | null ;
2020}
2121
2222/**
You can’t perform that action at this time.
0 commit comments