-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: data-items action value #2807
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, nice straightforward solution. And great to add debug logs for dynamic data updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional test passed. And I'm so happy to see the dynamic data changes logged in the console :)
PR Checklist
Description
Fix issue where actions triggered from within a
data-items
loop would not correctly parse the value of the triggering rowthis.value
variableReview Notes
Should fix case in debug_data_items_actions_2
Author Notes
This also now added console logs anytime a
set_item
orset_data
action is calledDev Notes
The issue occurs because due to the way data_items keep their own local variable references, and avoid notifying parent template of inner value changes (updated in #2706). The problem with this is that the parent template is in charge of parsing any
this.value
instances with the row value.There were two possible fixes/workarounds, this first would be to move similar logic to the
data-items
action interceptor to handle replacement, the second would be to pass the current value of the triggering row with the action so that it can be replaced from there. As we already have atriggered_by
variable attached to each action it made the most sense to simply use this for replacement instead of looking at the parenttemplateRowMap
There may be some minor conflicts between here and draft PR #2753. It would probably be good to try and revisit/update #2753 post-merge to make sure the relevant changes are also copied across
Git Issues
Closes #
Screenshots/Videos
Example - Using radio_button_grid inside data_items loop to dynamically set item to match value
Screenity.video.-.Feb.21.2025.mp4
Example - Updated console logs
