Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Overlay throws error when self-managed tooltip is removed from action-button #3325

Closed
1 task done
spdev3000 opened this issue Jun 19, 2023 · 1 comment · Fixed by #3456
Closed
1 task done
Labels
bug Something isn't working Component: Overlay Overlay v2 Confirmed Post overlay API Review after Overlay V2 Ships triage An issue needing triage

Comments

@spdev3000
Copy link
Collaborator

Code of conduct

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

Impacted component(s)

Overlay, Tooltip

Expected behavior

When a tooltip with self-managed attribute has been added to an action-button and it's later removed - and the user hovers over that action-button - nothing should happen.

Actual behavior

When a self-managed tooltip is removed from action-button and the user hovers over it later, overlay system throws error:

TypeError: Cannot read properties of null (reading 'dispatchEvent')
    at n.open (https://srv.divriots.com/packd/@spectrum-web-components/action-button/sp-action-button.js,@spectrum-web-components/icon/sp-icon.js,@spectrum-web-components/icons-workflow,@spectrum-web-components/overlay/overlay-trigger.js,@spectrum-web-components/story-decorator/decorator.js,@spectrum-web-components/tooltip/sp-tooltip.js,lit-element,lit-html,lit/decorators.js,tslib:21073:6957)
    at n.open (https://srv.divriots.com/packd/@spectrum-web-components/action-button/sp-action-button.js,@spectrum-web-components/icon/sp-icon.js,@spectrum-web-components/icons-workflow,@spectrum-web-components/overlay/overlay-trigger.js,@spectrum-web-components/story-decorator/decorator.js,@spectrum-web-components/tooltip/sp-tooltip.js,lit-element,lit-html,lit/decorators.js,tslib:21073:6416)
    at openOverlay (https://srv.divriots.com/packd/@spectrum-web-components/action-button/sp-action-button.js,@spectrum-web-components/icon/sp-icon.js,@spectrum-web-components/icons-workflow,@spectrum-web-components/overlay/overlay-trigger.js,@spectrum-web-components/story-decorator/decorator.js,@spectrum-web-components/tooltip/sp-tooltip.js,lit-element,lit-html,lit/decorators.js,tslib:13762:14514)
    ``` 
   This is probably due to the fact, that removing the self-managed tooltip doesn't refresh/remove the related overlay functionality.
   This doesn't happen with wrapped action-button and tooltip inside `<overlay-trigger>` parent element as `slot="trigger"` and `slot="hover-content"` 

### Screenshots

_No response_

### What browsers are you seeing the problem in?

_No response_

### How can we reproduce this issue?

1. Go to https://studio.webcomponents.dev/edit/l0KvlnBLi53rKAFXgqMn/src/index.ts?p=stories
2. Wait 3 secs
3. Hover over first (left) action-button
4. Check console
5. See error


### Sample code that illustrates the problem

https://studio.webcomponents.dev/edit/l0KvlnBLi53rKAFXgqMn/src/index.ts?p=stories

### Logs taken while reproducing problem

_No response_
@spdev3000 spdev3000 added bug Something isn't working Component: Overlay triage An issue needing triage labels Jun 19, 2023
@Westbrook Westbrook added the Post overlay API Review after Overlay V2 Ships label Jun 22, 2023
@Westbrook
Copy link
Contributor

Confirmed as corrected in the new Overlay API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Component: Overlay Overlay v2 Confirmed Post overlay API Review after Overlay V2 Ships triage An issue needing triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants