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

ReflexElement element size is not updated when the value passed to minSize prop is changed #194

Open
nguyenvu9405 opened this issue Apr 2, 2024 · 3 comments

Comments

@nguyenvu9405
Copy link

When changing the minSize prop of the ReflexElement, the size of the element displayed on UI will not reflect the change:
For example:

  • The initial value of minSize is 0, the size of the ReflexElement element is 0. Later, when the prop value changed to 200px, the size of the element is still 0
@leefsmp
Copy link
Owner

leefsmp commented Apr 2, 2024

the minSize and maxSize properties are currently only taken into consideration in the layout computation at first render and after a user interaction with a splitter. I would suggest forcing a re-render of the parent component if you are changing any of those properties programmatically.

@nguyenvu9405
Copy link
Author

Hi @leefsmp , thanks for your reply. I curious on why minSize and maxSize are only taken into consideration at first render. I see that when flex changed, the computation will be re-calculated. Why this is not applied also for minSize and maxSize?

I tried to re-render the parent component before, but this did not work. Re-mounting the parent component would work but this would hurt the performance and also have some issues with our specific application logic.

@leefsmp
Copy link
Owner

leefsmp commented Apr 22, 2024

It's just not implemented at the moment, changes to those properties are not being watched. So far I haven't had the need to change min/max size of a layout dynamically after it has been rendered. And you are the first one requesting it as well. Typically they will be set to some value and not changed. I'll see if I can implement it soon, unless you want to give a try at a PR.

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

No branches or pull requests

2 participants