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

sl-textarea may throw error on disconnectedCallback because input element is not found #1985

Closed
schilchSICKAG opened this issue Apr 19, 2024 · 1 comment
Labels
bug Things that aren't working right in the library.

Comments

@schilchSICKAG
Copy link
Contributor

Describe the bug

I recently ran into problems using <sl-textarea /> in a Karma test environment. When using the <sl-textarea /> in Karma tests, the following error is thrown: Uncaught TypeError: Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element'. It seems the Element reference this.input is not there anymore when disconnectCallback is run. This may easily be prevented by checking for the existence of this.input in the callback.

We already fixed this in our own fork of shoelace (synergy-design-system/synergy-design-system#437) and would also be willing to provide a PR for this problem.

To Reproduce

This is kind of hard to reproduce. Our test suite has more than two hundred tests for various components. However, in smaller setups using Karma I was not able to reproduce this easily.

Browser / OS

  • OS: [e.g. Mac, Windows] MacOS
  • Browser: [e.g. Chrome, Firefox, Safari] Chrome (instrumented via Karma)
  • Browser version: [e.g. 22] 124.0
@schilchSICKAG
Copy link
Contributor Author

Closed via #1986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

1 participant