litho icon indicating copy to clipboard operation
litho copied to clipboard

SNAP_TO_CENTER not working when sticky property is true

Open massanchik opened this issue 5 years ago • 1 comments

Version

ext.litho_version = '0.33.0'

Issues and Steps to Reproduce

I'm using tutorial code and at the end there is summary:

Some more fun things you can try:

  • SingleComponentSection has a few interesting props. See if you can make the horizontal scrolling row stick to the top

I'm just added sticky(true) to SingleComponentSection

@GroupSectionSpec
object ListSectionSpec {
    @OnCreateChildren
    fun onCreateChildren(c: SectionContext): Children {
        return Children.create()
            .child(
                SingleComponentSection.create(c)
                    **.sticky(true)**
...
                         .recyclerConfiguration(ListRecyclerConfiguration.create()
                                .orientation(LinearLayout.HORIZONTAL)
                                .reverseLayout(false)
                                **.snapMode(SNAP_TO_CENTER)**
                                .build())
...

it sticks but don't snaps any more to the center of a list item.

Expected Behavior

I guess it should snap properly regardless of sticky prop state

massanchik avatar Jan 08 '20 02:01 massanchik

Hey @massanchik, Thanks for reporting, we'll check it out.

adityasharat avatar Jan 08 '20 12:01 adityasharat