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
<sp-icon-help>
<sp-tooltip self-managed>Help is on the way</sp-tooltip>
</sp-icon-help>
And given that no focusable element can be found in the parent tree of the sp-tooltip, I expect that the focusable element to end up being the document, and that a warning would be thrown when window.__swc.DEBUG === true so that I am instructed on how to provide an accessible, focusable trigger for my tooltip.
Actual behavior
When window.__swc.DEBUG === true, the search loop is closed and the trigger is the document.
We get the expected warnings in the console.
However, when window.__swc.DEBUG === false, nothing is ever returned from the search loop, ending up in an infinite loop.
While this is a problem resulting from an incorrect usage of self-managed, developers may ignore the warnings in the console, as it does not create a loop in environments where DEBUG is true and end up with the infinite loop in production.
Screenshots
No response
What browsers are you seeing the problem in?
No response
How can we reproduce this issue?
In the code below, replace window.__swc.DEBUG with false (or directly in the browser console)
Open the Tooltip self-managed storybook
Remove the focusable element and replace it with a div
Check console
See error
Sample code that illustrates the problem
while (!triggerElement?.matches?.(focusableSelector)) {
start =
triggerElement.assignedSlot || (triggerElement as HTMLElement);
root = start.getRootNode();
/* c8 ignore next 13 */
if (window.__swc.DEBUG) {
if (root === document) {
window.__swc.warn(
this,
`Self managed [${this.localName}](https://app.slack.com/client/E23RE8G4F/$%7Bthis.localName%7D) elements walk up the composed tree to acquire a trigger element. No trigger element was found before the document.`,
'https://opensource.adobe.com/spectrum-web-components/components/tooltip#self-managed-overlays',
{
level: 'high',
}
);
return root as HTMLElement;
}
}
triggerElement = (start.parentElement ||
(root as ShadowRoot).host ||
/* c8 ignore next 1 */
root) as HTMLElement;
}
return triggerElement;
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered:
Code of conduct
Impacted component(s)
sp-tooltip
Expected behavior
Given the below code:
And given that no focusable element can be found in the parent tree of the
sp-tooltip
, I expect that the focusable element to end up being the document, and that a warning would be thrown whenwindow.__swc.DEBUG === true
so that I am instructed on how to provide an accessible, focusable trigger for my tooltip.Actual behavior
When
window.__swc.DEBUG === true
, the search loop is closed and the trigger is thedocument
.We get the expected warnings in the console.
However, when
window.__swc.DEBUG === false
, nothing is ever returned from the search loop, ending up in an infinite loop.While this is a problem resulting from an incorrect usage of
self-managed
, developers may ignore the warnings in the console, as it does not create a loop in environments where DEBUG istrue
and end up with the infinite loop in production.Screenshots
No response
What browsers are you seeing the problem in?
No response
How can we reproduce this issue?
window.__swc.DEBUG
withfalse
(or directly in the browser console)div
Sample code that illustrates the problem
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered: