CrowdStrike / ember-velcro

Ember Velcro sticks one element to another with Floating UI.
MIT License
13 stars 8 forks source link

Modifier cleanup needs improvement #149

Open lukemelia opened 1 year ago

lukemelia commented 1 year ago

Currently, the modifier calls floating-ui's autoUpdate in its modify method, which will run whenever an input changes. The method captures the cleanup function that autoUpdate returns and registers it as a destructor, but that can still result in multiple autoUpdates being registered.

Instead, the modifier should capture the last cleanup method and call it at the beginning of the modify method, if present. (There will be none captured the first time the modifier instance runs.)

NullVoxPopuli commented 1 year ago

Ye, i'd like to see a function-modifier implementation

NullVoxPopuli commented 3 weeks ago

fwiw, I'm continuing development over in https://ember-primitives.pages.dev/

NullVoxPopuli commented 3 weeks ago

Resolved in https://github.com/universal-ember/ember-primitives/pull/380