Vestride / Shuffle

Categorize, sort, and filter a responsive grid of items

Home Page:https://vestride.github.io/Shuffle/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Force update even on disabled shuffleInstance

hirbod opened this issue · comments

Shuffle version
v5.2.3

Describe the bug
calling update on disabled shuffleInstance does not relayout.

I'm not sure if you consider this a bug or if it's by design but I disable the shuffle right after initialization because I don't won't to rely on window.resize, rather I am using ResizeObserver for a more performant way. I want to call update but this does nothing as long as the instance is disabled.

I would love to force a re-layout whenever I call the update method (maybe consider to extend update(force))
Don't know what you think about it. Right now, I have to call .enable() and .disable() immediate in my ResizeObserver callback to trigger what I try to achieve.

Added a force option in v6 to the update method https://github.com/Vestride/Shuffle/releases/tag/v6.0.0

Also, v6 now uses ResizeObserver instead of the window resize event. Thanks for the suggestion!