Skip to content

[lit-labs/observers] ResizeController cannot easily observe a target other than host #3147

Closed

Description

@sorvell

Which package(s) are affected?

Observers (@lit-labs/observers)

Description

ResizeController accepts a target element to observe. It observes the given target when the host is connected and/or when the controller is added to the host. Unfortunately, the target is set after this, so if the host is already connected, the target doesn't get observed.

Reproduction

https://lit.dev/playground/#gist=c79371cc956785c4cb5ed5a99cb93cbf

Workaround

The user must manually call observe to workaround this issue. This is demonstrated in the repro.

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

all

Browser/OS/Node environment

All

Activity

  1. self-assigned this
    on Jul 19, 2022
  2. moved this to 📋 Triaged in Lit Project Boardon Sep 9, 2022
  3. AndrewJakubowicz commented on Sep 28, 2022

    @AndrewJakubowicz
    Contributor

    Fixed in #3293

  4. Repository owner moved this from 📋 Triaged to ✅ Done in Lit Project Boardon Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions