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

fix isTreeItem method when called with non-element nodes #1026

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

tao-cumplido
Copy link
Contributor

Fixes #1025

The isTreeItem method was wrongly typed as accepting Element instances but gets called on Nodes in SlTree's handleTreeChanged and these Nodes can also be non-elements without getAttribute method.

A more underlying problem is the tsconfig setting strictFunctionTypes set to false. If it had been true TS would have caught the calls to isTreeItem where it is passed any Node.

@vercel
Copy link

vercel bot commented Nov 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
shoelace ✅ Ready (Inspect) Visit Preview Nov 24, 2022 at 10:34AM (UTC)

@claviska claviska merged commit 602a863 into shoelace-style:next Nov 24, 2022
@claviska
Copy link
Member

Thanks!

@tao-cumplido tao-cumplido deleted the fix-is-tree-item-check branch November 24, 2022 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isTreeItem errors on dynamically added comment nodes
2 participants