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

Can not set flexGrow on SceneFlexLayout #885

Open
LouaiMaayah1 opened this issue Sep 2, 2024 · 1 comment
Open

Can not set flexGrow on SceneFlexLayout #885

LouaiMaayah1 opened this issue Sep 2, 2024 · 1 comment

Comments

@LouaiMaayah1
Copy link

On the Documentation it is written that flexGrow can be set in the SceneFlexLayoutState. However that is not possible, and I am running into some issues with the spacing because I cannot set the flexGrow to 0.

To solve this issue I am importing a CSS file with the class name of the div and setting the flexGrow there to 0.

is there any other way? or is it possible to bring back flexGrow to the SceneFlexLayout?

@azadsagar
Copy link

azadsagar commented Jan 30, 2025

I have the same issue, i can't set flexGrow property to 0.
@LouaiMaayah1 As a workaround I used property xSizing and ySizing setting it tocontent. I saw the code and they really don't have property flexGrow. Ref:

if (parentDirection === 'column') {
if (state.height) {
style.height = state.height;
} else {
style.flexGrow = ySizing === 'fill' ? 1 : 0;
}
if (state.width) {
style.width = state.width;
} else {
style.alignSelf = xSizing === 'fill' ? 'stretch' : 'flex-start';
}
} else {
if (state.height) {
style.height = state.height;
} else {
style.alignSelf = ySizing === 'fill' ? 'stretch' : 'flex-start';
}
if (state.width) {
style.width = state.width;
} else {
style.flexGrow = xSizing === 'fill' ? 1 : 0;
}
}

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