I only want to update the value of the inner h1, however liveview is replacing the whole nested structure. JS acts on the outer div to change display. How do I prevent liveview from resetting the whole structure?
EDIT: A live component cannot be used, unless is can be added conditionally when the template is not live.
LiveView controls the state of the DOM. You should use a hook if you want to have javascript work within a live view controlled area so that the changes you want to do in JS can be reapplied after each morphdom invocation.
ty Why is it controlling and area larger than defined? I only want it to update <%= @waiting_text %> or "waiting-text" and nothing beyond it… the granularity does not exist?
The area it’s defined is everything in the live layout, not just the part inside of <%= %>. It’s a “live view” not just a dynamic spot on the page. The whole view is controlled by morphdom. This allows the server to operate as the source of truth on what is shown to the user.