August 2024
Intermediate to advanced
186 pages
4h 3m
English
In apps that display a list of items (such as a todo app), it’s often desirable to allow users to initiate editing text associated with one of the items (such as a todo description) by clicking the text.

One way to achieve this is to have the HTML for each item include an element to display the static text value and an input element for editing the value. The Alpine x-show directive (covered in the next chapter) can be applied to each of these so that only one is actually shown at a time, based on whether the item is currently being edited.
This is the approach taken in the todo app at todo-hono.[44]
When text is clicked, the following ...
Read now
Unlock full access