spectrum-web-components
spectrum-web-components copied to clipboard
[Bug]: clicking on an overlay-trigger with hover content only does not close overlays triggered by click
trafficstars
Code of conduct
- [X] I agree to follow this project's code of conduct.
Impacted component(s)
Overlay
Expected behavior
I expect that, when clicking on anything outside of an overlay that is shown by click, that overlay should close.
This is true for everything on the page, except for things wrapped in an <overlay-trigger> that only have hover-content.
Actual behavior
Clicking on an <overlay-trigger> with only hover-content (no click-content) does not close other overlays opened by clicking.
Screenshots
No response
What browsers are you seeing the problem in?
Chrome
How can we reproduce this issue?
- Have two
<overlay-triggers>, one with onlyclick-content, and one with onlyhover-content - Click on the
<overlay-trigger>that hasclick-content - Hover on the
<overlay-trigger>that hashover-content - Click on the
<overlay-trigger>that hashover-content - The overlay shown by the
<overlay-trigger>that hasclick-contentdoes not close
Sample code that illustrates the problem
<style>
.friendly-target {
padding: 4px;
margin: 6px;
border: 2px solid black;
border-radius: 6px;
cursor: default;
}
</style>
<overlay-trigger placement="right">
<div class="friendly-target" slot="trigger">Click me</div>
<sp-tooltip slot="click-content" tip="right">
Ok, now hover the other trigger
</sp-tooltip>
</overlay-trigger>
<overlay-trigger placement="left">
<div class="friendly-target" slot="trigger">Then hover me</div>
<sp-tooltip slot="hover-content" delayed tip="right">
Now click my trigger -- I should stay open, but the other overlay should close
</sp-tooltip>
</overlay-trigger>
Logs taken while reproducing problem
No response