Skip to content

[Bug]: Views in List view in Tab view not updating correctly #1441

@jtormey

Description

@jtormey

What happened?

I noticed that if an event updates the order of items in a list and at the same time updates a property of a list item in a tab view, after navigating from another tab, then the list no longer behaves as expected after the first update.

Without reordering (working):

Simulator.Screen.Recording.-.iPhone.15.-.2024-09-11.at.16.39.27.mp4

With reordering (not working) after navigating from another tab:

Simulator.Screen.Recording.-.iPhone.15.-.2024-09-11.at.16.42.26.mp4

Note that the circular indicator does not change even as the list order changes.

Relevant code:

<TabView selection={@selection} phx-change={@on_change}>
  <VStack tag="..." style="tabItem(:item)">
    <Label template="item" systemImage="...">
      ...
    </Label>
    <List style="listStyle(.plain)">
      <Section>
        <Text template="header">
          Meat counter
        </Text>
        <HStack id={"item_" <> item.id} :for={item <- @items}>
          <Image
            systemName={if item.in_cart, do: "largecircle.fill.circle", else: "circle"}
            style="imageScale(.large); foregroundColor(.accentColor);"
            phx-click="toggle_completed"
            phx-value-id={item.id}
          />
          <Text>
            <%= item.title %>
          </Text>
          <LabeledContent>
            <%= item.detail %>
          </LabeledContent>
        </HStack>
      </Section>
    </List>
  </VStack>
</TabView>

Library Version

0.3.0

Xcode Version

15.4 (15F31d)

Swift Version

No response

On which device or simulator are you running into the problem?

iPhone

Target Device Operating System Version

17.2

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv0.3

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions