spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Bug]: Tooltip in ActionMenu produces SWC warning

Open spdev3000 opened this issue 9 months ago • 1 comments

Code of conduct

  • [x] I agree to follow this project's code of conduct.

Impacted component(s)

ActionMenu, Tooltip

Expected behavior

No warning is logged when using an tooltip inside an action-menu.

Actual behavior

Currently when I use something like:

<sp-action-menu>
    <sp-tooltip slot="tooltip" self-managed placement="bottom">
        Your tooltip string is here
    </sp-tooltip>
    <span slot="label">Available shapes</span>
    <sp-menu-item value="shape-1-square">Square</sp-menu-item>
    <sp-menu-item value="shape-2-triangle">Triangle</sp-menu-item>
    <sp-menu-item value="shape-3-parallelogram">Parallelogram</sp-menu-item>
</sp-action-menu>

this produces an SWC warning like:

Self managed <sp-tooltip> elements walk up the composed tree to acquire a trigger element. No trigger element was found before the document.

Inspect this issue in the follow element: <sp-tooltip slot=​"tooltip" self-managed placement=​"bottom" dir=​"ltr">​…​</sp-tooltip>​slot 

https://opensource.adobe.com/spectrum-web-components/components/tooltip#self-managed-overlays

Screenshots

Image

What browsers are you seeing the problem in?

Chrome

How can we reproduce this issue?

  1. Go to https://opensource.adobe.com/spectrum-web-components/storybook/index.html?path=/story/action-menu--tooltip-description-and-placement&globals=system:spectrum-two
  2. Open dev console
  3. Check warning is logged

Sample code or abstract reproduction which illustrates the problem

No response

Severity

SEV 5

Logs taken while reproducing problem

No response

spdev3000 avatar May 09 '25 14:05 spdev3000

swc-890

najikahalsema avatar May 13 '25 21:05 najikahalsema