Skip to content

Commit

Permalink
Add missing props to LazyGrid. mainAxisWrapContent
Browse files Browse the repository at this point in the history
Summary:
Was looking at my oncall support request and it seems we didnt add that for Lazy Grid.

T205271760

Reviewed By: adityasharat

Differential Revision: D64688901

fbshipit-source-id: 655e4c26741492a78ccd7e3c0a76e2ad1cc1568e
  • Loading branch information
Anna Powolny authored and facebook-github-bot committed Oct 21, 2024
1 parent 89cace8 commit 5290a23
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ internal object CollectionLayouts {
useBackgroundChangeSets: Boolean = false,
columns: Int = 2,
preAllocationHandler: PreAllocationHandler?,
enableStableIds: Boolean
enableStableIds: Boolean,
mainAxisWrapContent: Boolean = false,
): CollectionLayout =
object :
CollectionLayout(
Expand All @@ -184,7 +185,9 @@ internal object CollectionLayouts {
useBackgroundChangeSets = useBackgroundChangeSets,
preAllocationHandler = preAllocationHandler,
isCircular = false,
enableStableIds = enableStableIds) {
enableStableIds = enableStableIds,
mainAxisWrapContent = mainAxisWrapContent,
) {
override fun createRecyclerConfigurationBuilder(): RecyclerConfiguration.Builder =
GridRecyclerConfiguration.create()
.snapMode(snapMode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ inline fun ResourcesScope.LazyGrid(
isTopFadingEnabled: Boolean = true,
isBottomFadingEnabled: Boolean = true,
fadingEdgeLength: Dimen? = null,
mainAxisWrapContent: Boolean = false,
preAllocationHandler: PreAllocationHandler? =
context.lithoConfiguration.componentsConfig.preAllocationHandler,
shouldExcludeFromIncrementalMount: Boolean = false,
Expand All @@ -92,7 +93,9 @@ inline fun ResourcesScope.LazyGrid(
useBackgroundChangeSets = useBackgroundChangeSets,
preAllocationHandler = preAllocationHandler,
columns = columns,
enableStableIds = enableStableIds),
enableStableIds = enableStableIds,
mainAxisWrapContent = mainAxisWrapContent,
),
itemAnimator,
itemDecoration,
clipToPadding,
Expand Down

0 comments on commit 5290a23

Please sign in to comment.