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
Tooltips get disabled when isOpen prop changes (or when the dialog is mounted), and get re enabled in raf.
However, if the dialog gets unmounted tooltips do not get re enabled.
I think this lines are responsible for the behaviour, and it looks like it should be something like this instead: (upd: ignore this, this breaks tooltips inside Dialog)
React.useEffect(()=>{if(isOpen){// @ts-ignorewindow.__REACH_DISABLE_TOOLTIPS=true;return()=>{window.requestAnimationFrame(()=>{// Wait a frame so that this doesn't fire before tooltip does// @ts-ignorewindow.__REACH_DISABLE_TOOLTIPS=false;});};}},[isOpen]);
I've noticed there is also a problem if <Menu /> is rendered conditionally.
If menu is unmounted while being in the open state (for example MenuItem might delete the object that had the open menu) tooltips no longer work from focus.
The cause (no cleanup in the effect) and solution (adding it) are similar.
nulladdict
changed the title
[Tooltip] [Dialog] Tooltips get disabled forever if dialog is rendered conditionally
[Tooltip] [Dialog] [Menu-Button] Tooltips get disabled forever if dialog is rendered conditionally
Dec 22, 2020
nulladdict
changed the title
[Tooltip] [Dialog] [Menu-Button] Tooltips get disabled forever if dialog is rendered conditionally
[Tooltip] [Dialog] [Menu-Button] Tooltips get disabled forever if cimponent is rendered conditionally
Dec 22, 2020
I've also noticed that tooltips nested in the Dialog no longer show up after #521, even though #390 states it shouldn’t be the case
nulladdict
changed the title
[Tooltip] [Dialog] [Menu-Button] Tooltips get disabled forever if cimponent is rendered conditionally
[Tooltip] [Dialog] [Menu-Button] Tooltips get disabled forever if component is rendered conditionally
Dec 22, 2020
🐛 Bug report
Current Behavior
Tooltips get disabled when
isOpen
prop changes (or when the dialog is mounted), and get re enabled in raf.However, if the dialog gets unmounted tooltips do not get re enabled.
Expected behavior
Tooltips get re enabled when dialog is unmounted
Reproducible example
Codesandbox link
Suggested solution(s)
I think we should enable tooltips in raf when dialog gets unmounted
Your environment
The text was updated successfully, but these errors were encountered: