muuri icon indicating copy to clipboard operation
muuri copied to clipboard

Retrieve the position of hidden grid items in custom layout function

Open romanstetsyk opened this issue 1 year ago • 0 comments

First of all, thanks for all your hard work!

I'm trying to create a custom layout function (of type LayoutFunction) but having trouble retrieving the position of items before they were hidden. Please take a look at the following example:

  1. A grid has three visible items. My layout function receives an array of them (type Item[] as its third argument) and places them according to the function's logic.
  2. I hide one item. The layout function is invoked. The array of items has only two items.
  3. Now, I show the hidden item. The array of three items is passed as an argument to the layout function. But the previously hidden item has a position {left: 0, top: 0} for some reason.

My question is, how do I place it where it was before hiding? Could you show an example of a custom layout besides the one in the documentation?

romanstetsyk avatar Jun 28 '23 21:06 romanstetsyk