Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve the position of hidden grid items in custom layout function #555

Open
romanstetsyk opened this issue Jun 28, 2023 · 0 comments
Open

Comments

@romanstetsyk
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant