Conversation
ListItem::applyAttributes never read a trailing press attribute, so the handler could only be set with the fluent onTrailingPress() builder. Both renderers already fire on_trailing_press from the trailing icon button, so accepting on-trailing-press / onTrailingPress (the same spellings as on-trailing-change) is the whole fix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting
on-trailing-presson a<native:list-item>did nothing. The trash button showed up, but tapping it never reached the component. This came up in several benchmark runs building a todo app, and people ended up rebuilding rows by hand.The native side was fine. Both renderers already send
on_trailing_presswhen the trailing icon button is tapped. The problem was inListItem::applyAttributes(), which readon-leading-changeandon-trailing-changebut never read a trailing press attribute. So the callback could only be set with the fluentonTrailingPress(). It now acceptson-trailing-pressandonTrailingPress, the same spellings as the change callbacks. I also added a line and an example to the Boost guideline.One thing to watch: the accessibility docs page shows
@trailing-press="...". That form still won't work, and a plugin can't fix it. Core's precompiler turns unknown@name=attributes into_event-namechild-component bindings, and the collector strips those from plain elements beforeapplyAttributesruns. The docs should useon-trailing-pressinstead.Testing:
tests/ListItemTrailingPressTest.phpcovers both spellings, a tag compiled through the real precompiler with a bound argument, the no-callback case and the fluent builder. Five of those fail on main. The full suite passes against nativephp/mobile 4.5.2.on-trailing-press="deleteTodo({{ $todo['id'] }})". Tapping a row's trash button removed the row and updated a "Deleted: 2" label. The@trailing-pressversion of the same row did nothing, which is how I found the core issue above.🤖 Generated with Claude Code