Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[lit-html] Ref callbacks incorrect when unbound class methods used as callbacks #2677

@kevinpschaaf

Description

@kevinpschaaf

Description

User reported bug: Ref callbacks are called incorrectly (with undefined when they shouldn't be) when the same callback is passed to multiple refs. Particularly, if an unbound LitElement method is passed to ref, this will result in incorrect callbacks when multiple instances of that element are used.

Live Reproduction Link

https://codesandbox.io/s/lit-ref-8lwb73?file=/src/index.js

Expected Results

Ref callback only called once for initial render for each element instance.

Actual Results

First element ref callback called correctly. Second element callback first called with undefined, then with the node, which is unexpected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions