You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've received a request to add a programmatic way to close EUI tooltips: #5883
I've opted to close the previous issue and open this new one as a feature request. There was a fair bit of conversation about use cases including programmatic closures and removing focus from buttons with tooltips. My last comment to the original post was that the EUI team would explore a programmatic means to close tooltips, but that removing focus from elements (buttons primarily) that fire tooltip events was not recommended.
The text was updated successfully, but these errors were encountered:
As it turns out, controlling internal EuiToolTip visibility state is already currently achievable (due to it being a class component) via ref, e.g.
consttoolTipRef=useRef<EuiToolTip>(null);consthideToolTip=()=>toolTipRef.current?.hideToolTip();return(<EuiToolTipref={toolTipRef}content="Tooltip content"><EuiButtononClick={hideToolTip}>
Hides tooltip on click
</EuiButton></EuiToolTip>);
After speaking to @1Copenut, we've decided against publicly documenting this functionality - this control has a lot of accessibility implications, and as a team, EUI only wants to recommend it to consumers for very very specific use cases.
The below CodeSandbox example (a button that toggles a flyout/modal/focus trap and consumers not wanting the tooltip to be re-shown on when the focus trap closes) is one such use case, primarily for when the tooltip occludes another UI element:
We've received a request to add a programmatic way to close EUI tooltips: #5883
I've opted to close the previous issue and open this new one as a feature request. There was a fair bit of conversation about use cases including programmatic closures and removing focus from buttons with tooltips. My last comment to the original post was that the EUI team would explore a programmatic means to close tooltips, but that removing focus from elements (buttons primarily) that fire tooltip events was not recommended.
The text was updated successfully, but these errors were encountered: