Skip to content

bug(<section-list>): items not rendering correctly in very specific scenario #1248

@flochtililoch

Description

@flochtililoch

This is a pretty edge case bug, causing the section list to not render when preceded by 3 leading empty <section-title</<item>. It's unclear at this point if the issue is in Hyperview codebase, or with the React Native SectionList component.

Markup UI
          
            <doc xmlns="https://hyperview.org/hyperview">
              <screen>
                <styles>
                  <style id="body" flex="1"/>
                  <style id="list" backgroundColor="lightgray" marginVertical="60" />
                </styles>
                <body style="body">
                  <section-list style="list">
                    <section-title/>
                    <item key="a"></item>
                    <section-title/>
                    <item key="b"></item>
                    <section-title/>
                    <item key="c"></item>
                    <section-title/>
                    <item key="d"><text>Foo</text></item>
                    <item key="e"><text>Bar</text></item>
                    <item key="f"><text>Baz</text></item>
                  </section-list>
                </body>
              </screen>
            </doc>
          
        
Image
Change: added a <text/> element within the first <section-title/>
          
            <doc xmlns="https://hyperview.org/hyperview">
              <screen>
                <styles>
                  <style id="body" flex="1"/>
                  <style id="list" backgroundColor="lightgray" marginVertical="60" />
                </styles>
                <body style="body">
                  <section-list style="list">
                    <section-title><text/></section-title>
                    <item key="a"></item>
                    <section-title/>
                    <item key="b"></item>
                    <section-title/>
                    <item key="c"></item>
                    <section-title/>
                    <item key="d"><text>Foo</text></item>
                    <item key="e"><text>Bar</text></item>
                    <item key="f"><text>Baz</text></item>
                  </section-list>
                </body>
              </screen>
            </doc>
          
        
Image
Change: added a <text/> element within the first <item/>
          
            <doc xmlns="https://hyperview.org/hyperview">
              <screen>
                <styles>
                  <style id="body" flex="1"/>
                  <style id="list" backgroundColor="lightgray" marginVertical="60" />
                </styles>
                <body style="body">
                  <section-list style="list">
                    <section-title/>
                    <item key="a"><text/></item>
                    <section-title/>
                    <item key="b"></item>
                    <section-title/>
                    <item key="c"></item>
                    <section-title/>
                    <item key="d"><text>Foo</text></item>
                    <item key="e"><text>Bar</text></item>
                    <item key="f"><text>Baz</text></item>
                  </section-list>
                </body>
              </screen>
            </doc>
          
        
Image
Change: removed the last empty <section-title/> / <item/> combo
          
            <doc xmlns="https://hyperview.org/hyperview">
              <screen>
                <styles>
                  <style id="body" flex="1"/>
                  <style id="list" backgroundColor="lightgray" marginVertical="60" />
                </styles>
                <body style="body">
                  <section-list style="list">
                    <section-title/>
                    <item key="a"></item>
                    <section-title/>
                    <item key="b"></item>
                    <section-title/>
                    <item key="d"><text>Foo</text></item>
                    <item key="e"><text>Bar</text></item>
                    <item key="f"><text>Baz</text></item>
                  </section-list>
                </body>
              </screen>
            </doc>
          
        
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions