Closed ogrotten closed 7 months ago
The syntaxes for the methods appears to be the exact same, but firing hide/show the exact same way doesn't work for show.
show
The muuri object is set up as mu and so far it works in every other respect.
mu
I've setup images as an array of HTMLElements and added custom attribs/data to it for generalities.
images
changed comes from a higher component, and this function fires whenever it has been set like shown.
changed
changed = { id: myObject.id, added: false } const setItemVis = (changed) => { const el = images.filter(i => i.getAttribute('data-muuri-id') === changed.id) const item = mu.getItem(el[0]) if (changed.added) mu.show([item]) else mu.hide([item]) changed = null const check = mu?.getItems().filter(i => i.isVisible()) console.log(`\nchk.length, chk`, chk.length, chk) }
onFinish fires, but check as defined above does not change. IOW, if there's 5 imgs and I add one, it still says 5.
onFinish
check
mu.on("layoutEnd") does not fire. even when set to mu.show([item], { layout: true })
mu.on("layoutEnd")
mu.show([item], { layout: true })
Of course, reloading the page,
Suggestions?
NEVERMIND.
Took a while, but I found that the show/hide toggle data I was passing in to muuri was bad.
The syntaxes for the methods appears to be the exact same, but firing hide/show the exact same way doesn't work for
show
.The muuri object is set up as
mu
and so far it works in every other respect.I've setup
images
as an array of HTMLElements and added custom attribs/data to it for generalities.changed
comes from a higher component, and this function fires whenever it has been set like shown.onFinish
fires, butcheck
as defined above does not change. IOW, if there's 5 imgs and I add one, it still says 5.mu.on("layoutEnd")
does not fire. even when set tomu.show([item], { layout: true })
Of course, reloading the page,
Suggestions?