I have problem with createOptionForm and columnSpan, not working correctly check screenshot.
should be half / half and not like screenshot and my code look like this
20 Replies
Please follow the #✅┊rules about formatting code examples.
sorry I will format the code and submit again
Just edit it. No need to submit again. 😃
done 🙂
I guess the problem with the wrapper
You should look at the docs for layout components. Still looks odd though that the grids aren’t two equal columns. So, something else other than the code you shared is throwing it off. https://filamentphp.com/docs/3.x/forms/layout/getting-started
Also, undocumented, for some reason is a Group layout component that will probably help with this layout.
Just note this pronlem happen only in createOptionForm and not if using schema
Yea. Something is off. But I’m not seeing anything obvious based on what you shared.
if I remove ->columnSpan(['default' => '2']) is showing full column for each input
same issue if you do this in demo
https://github.com/filamentphp/demo
GitHub
GitHub - filamentphp/demo: Source code for the demo.filamentphp.com...
Source code for the demo.filamentphp.com website. Contribute to filamentphp/demo development by creating an account on GitHub.
What is your expected outcome?
2 columns, 5 columns. Etc.
this from demo as well
I want to have half / half 2 columns per row but equal width
Solution
Ok. So wrap all of the form schema in a Group::make([…fields])->columns()
2 columns is the default for the columns() modifier.
Group::make inside ->createOptionForm([ ?
Yes
I will try it
that works, thank you so much for your help