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
The documentation says, that "...[Tooltip.Provider] provides shared state for the tooltip components used within it". And then there is example with delayDuration and disableHoverableContent.
But is seems that those are the only props, that we can set defaults for, because all the other ones are auto-initialized in Root, and only nullish values can fall back to those set in the Provider.
So for example, if I want to have the value of disableCloseOnTriggerClick be read from the Provider, I can't do that, because if I then put <Tooltip.Root> without disableCloseOnTriggerClick prop, it would initialize to false and won't use the Provider's value.
I could work around it by setting those values on Root, but that'd defeat the purpose of having common settings in the Provider. I could also set those values to null, but that is not an accepted type for those fields.
This is the fragment in "tooltip/components/tooltip.svelte" that auto-initializes those values:
BTW, I had to set interactOutsideBehavior="ignore" in Content, in order to be able to see the effect of disableCloseOnTriggerClick, because any pointerdown event on the trigger element would close the tooltip immediately.
Maybe the trigger element shouldn't be treated as something "outside"?
Describe the bug
The documentation says, that "...[Tooltip.Provider] provides shared state for the tooltip components used within it". And then there is example with
delayDuration
anddisableHoverableContent
.But is seems that those are the only props, that we can set defaults for, because all the other ones are auto-initialized in Root, and only nullish values can fall back to those set in the Provider.
So for example, if I want to have the value of
disableCloseOnTriggerClick
be read from the Provider, I can't do that, because if I then put<Tooltip.Root>
withoutdisableCloseOnTriggerClick
prop, it would initialize tofalse
and won't use the Provider's value.I could work around it by setting those values on Root, but that'd defeat the purpose of having common settings in the Provider. I could also set those values to
null
, but that is not an accepted type for those fields.This is the fragment in "tooltip/components/tooltip.svelte" that auto-initializes those values:
I think it's a mistake, because in "tooltip-provider.svelte" those props are exposed to be set as defaults.
Reproduction
https://stackblitz.com/edit/vitejs-vite-esq3cy?file=src%2FApp.svelte
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: