-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: phx-delete index and List with Sections #1462
Comments
Is there an equivalent to this in HTML? Or is the an issue that would be unique to native? If so then it may be a bigger issue to solve properly |
i dont think this list sections markup is in html but there is more control of what is sent with the events, ie |
I cannot seem to find But as I'm understanding the issue, because you have two or more distinct lists, the |
Yes all those list events are LVN specific. Nothing like that in LV. It is a single My guess is that the One way to solve it is by adjusting the |
This sounds reasonable, we should go up the tree and find the next closest
This also seems reasonable. But I would probably advocate for |
I have not worked with LV for a while but i'm not sure if What ever the solution will be it would be good if the event handlers can be shared between web/mobile, or at least are as close as they can be, ie not using different names for the same thing. |
that was an incomplete thought on my part, the situation I was considering is if you wanted a |
but beyond that, what I need to get confirmation on is if we can even use |
Yes that's good point. I'm not sure how big of a practical issue it would be as you could define many attributes which some are used by click handler and some by delete handler. Small network efficiency overhead remains though. My main point with |
yeah we'll get this fixed for sure, legit bug. I'll disucss with the team next week which approach we should take |
I think we should remove the Instead, the |
With the <List>
<Section style='onDelete(perform: event("delete"))' phx-value-section="1">
<Text :for={i <- 1..10}><%= i %></Text>
</Section>
<Section style='onDelete(perform: event("delete"))' phx-value-section="2">
<Text :for={i <- 1..10}><%= i %></Text>
</Section>
</List> As a payload, you'll receive something like this: %{
"index_set" => [2],
"section" => "1"
} The |
@hypno2000 we're going to go with @carson-katri's suggestion ☝️ and that means removing |
What happened?
When
List
divided intoSection
's thenphx-delete
sends the index relative to the currentSection
that the item is in.For example if i have this:
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 modifierLibrary 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
The text was updated successfully, but these errors were encountered: