Skip to content

[Bug]: phx-delete index and List with Sections #1462

@hypno2000

Description

@hypno2000

What happened?

When List divided into Section's then phx-delete sends the index relative to the current Section that the item is in.

For example if i have this:

<List phx-delete="on_delete">
  <Section>
    <Text template={:header}>Section 1</Text>
    <Text template={:content}>Item 1-1</Text>
    <Text template={:content}>Item 1-2</Text>
  </Section>
  <Section>
    <Text template={:header}>Section 2</Text>
    <Text template={:content}>Item 2-1</Text>
    <Text template={:content}>Item 2-2</Text>
  </Section>
</List>

When i delete Item 2-2 then it sends %{"index" => 1} to event. It is not enough context for the server to know what to delete.

It would be nice if the id of the item is passed or allow some custom even handling with onDelete modifier

Library Version

3c4ddc1

Xcode Version

16

Swift Version

6.0

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

iPhone

Target Device Operating System Version

IOS 18

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv0.4

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions