svelteuidev / svelteui

SvelteUI Monorepo
https://svelteui.dev
MIT License
1.28k stars 64 forks source link

CSS `position` discrepancy between Tooltip and Menu #349

Open longnguyen2004 opened 1 year ago

longnguyen2004 commented 1 year ago

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

I stumbled across a weird bug with Menu that occurred under a very specific circumstance (that I couldn't write a minimal repro for yet), which causes the list to not be properly positioned. However, Tooltip rendered just fine. I managed to narrow it down to a styling discrepancy between the 2 components. Specifically, the menu's wrapper contains position: relative, while the tooltip's wrapper doesn't.

Now, this might be a floating-ui bug, or maybe a browser bug (but seeing that 2 browser engines suffer from the same issue, I highly doubt it), but I can confirm that overriding position to be static solved the problem for me. So why does Menu have position: relative but not Tooltip?

In which browser(s) did the problem occur?

Firefox, Chrome, Microsoft Edge

Steps To Reproduce

Can't write reproduction yet

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Relevant Assets

No response

BeeMargarida commented 1 year ago

Hi, sorry for taking so long to respond, but do you have any reproduction example or a code snippet? This is too vague which makes it difficult to investigate