Is partial component update possible? #20
Replies: 2 comments
-
This would be like |
Beta Was this translation helpful? Give feedback.
-
@Alex-Sichkar Apologies for slow reply, missed this one. If you use Alpine to position your dropdown the state should be maintained between successive server re-renders. Other attributes/styles added by outside JS would be lost. This is the same as you would experience with React/Vue and mixing outside JS that interferes with the DOM. The alternative is to split the component in two, a Dropdown and DropdownContent component, only updating the latter. The concept is that a sub-component is the partial. |
Beta Was this translation helpful? Give feedback.
-
Hi @samwillis,
What for? For example, we have a dropdown with live search functionality that is positioned using javascript adding certain styles. During the search, the entire component is redrawn and positioning is lost. We can reposition it, but that will cause flicker. It would be nice to be able to redraw only the contents of the menu. Though my approach may not be good, perhaps I should split the component apart? What do you think? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions