-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Refresh Grid after component size changes #20
Comments
Hi @derwydd, Thanks for Issues 😃 As a solution there is a way to detect the size change of each item of the grid, but it will greatly degrade performance. Instead, I'm considering an API to rerender the grid manually: /**
* It calls the API of the StackGrid instance
* when the height of the grid item changes.
*/
class YourComponent extends React.Component {
/**
* It simulates when the height of the grid item changes.
*/
something() {
this.node.updateLayout();
}
// ...
render() {
return (
<StackGrid
onInitialized={node => this.node = node}
>
{/* Grid items */}
</StackGrid>
);
}
} It is an idea to handle item clicks and run |
This would be great. The ability to call a function with in an event change make best sense. What would be the time frame for this? We would love to use this library in a production App. |
@derwydd , Thanks for quick response !
The promise is difficult, but I think we can release it this week.
Thanks, very encouraging for me... 😉 |
Hi @derwydd. Reference
|
We were able to implement, but it seems that it does not work in every GridItem height. We have some items/panels that are about 900px height and the height is dynamic and not set. Should we be setting the height? Also is there a way for a particular item to grow in width that is greater than the column width? |
The UI that we are using Material, I'm not sure if that is a factor Can I send you pictures via email to demonstrate what is happening? |
Hi @derwydd, Thank you for confirmation.
No, unfortunately
Thanks for your cooperation. Instead of e-mail, it is helpful to share the minimum reproducible code. |
I have an application that starts off with minimalized items. When the user clicks on a particular item it is re-rendered and the width and height changes. However, when the small component is replaced by the larger, the other un-clicked smaller components stack over the larger component as if it does not recognize that it is present. Only when I change the browser size does it re-render the grid correctly taking the larger component into exception.
<StackGrid columnWidth={350} duration={480} gutterWidth={5} gutterHeight={5} easing={easings.quartOut} appear={flip.appear} appeared={flip.appeared} enter={flip.enter} entered={flip.entered} leaved={flip.leaved} monitorImagesLoaded={true} > {this.groupLoop(groups, groupSelected)} </StackGrid>
With in groupLoop, its decides if the component is small or large, the large component is rendered by calling another component whereas the small was are not. I can give more details if needed.
The text was updated successfully, but these errors were encountered: