I am using LiveComponent for a mix of filter/search and in place edit using one component for the searching and then a nested component to in place edit individual items, in twig my search component looks like:
This all works as expected. However, triggering more than one form update will trigger the JS error below. The reason for this seems to be that data-original-data is removed from the edit components.
live_controller.js:1471 Uncaught (in promise) Error: Missing From Element originalData
at extended._shouldChildLiveElementUpdate (live_controller.js:1471:1)
at onBeforeElUpdated (live_controller.js:1366:1)
at morphEl (live_controller.js:492:1)
at morphChildren (live_controller.js:605:1)
at morphEl (live_controller.js:507:1)
at morphdom (live_controller.js:722:1)
at extended._executeMorphdom (live_controller.js:1357:1)
at extended._processRerender (live_controller.js:1224:1)
at live_controller.js:1199:1
I can work around this by adding data-original-data="{}" to the edit component to avoid the JS error. However, the component then still loses their state, in this case whether it should be rendered as input or text.
I am using LiveComponent for a mix of filter/search and in place edit using one component for the searching and then a nested component to in place edit individual items, in twig my search component looks like:
The actual search component has a getEntries() method that returns entries based on the current form state
My edit component in twig then looks like and has live actions to toggle the edit mode
This all works as expected. However, triggering more than one form update will trigger the JS error below. The reason for this seems to be that
data-original-data
is removed from the edit components.I can work around this by adding
data-original-data="{}"
to the edit component to avoid the JS error. However, the component then still loses their state, in this case whether it should be rendered as input or text.I have a fully working example https://github.com/glaubinix/ux-live-component-nested