You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case: multiple actions on your page can swap in a form in place of some view component. Ideally you want clicking on one of them to prevent clicking the others while the form is open, so you only have one form on the page at a time. A bit like the disable-element extension, only affecting an arbitrary number of components and persisted beyond the end of the request.
Something like the hx-swap-oob attribute, but e.g. hx-set-attribute-oob, where the value is e.g.:
At the moment you can kind of achieve this by removing the whole element with hx-swap and then restoring it later when you re-render the wider page after form submission, but it would be nice to be able to (at least) set other things disabled or read-only out of band, rather than having to rebuild all the elements from fragments and include them as swaps.
(Unsure about this)
Might be safer to just permit this for disabled/read-only rather than for arbitrary attributes? I don't have a strong feeling for which would be preferable, really
The text was updated successfully, but these errors were encountered:
Use case: multiple actions on your page can swap in a form in place of some view component. Ideally you want clicking on one of them to prevent clicking the others while the form is open, so you only have one form on the page at a time. A bit like the
disable-element
extension, only affecting an arbitrary number of components and persisted beyond the end of the request.Something like the
hx-swap-oob
attribute, but e.g.hx-set-attribute-oob
, where the value is e.g.:hx-set-attribute-oob="[css-selector]:add:disabled"
hx-set-attribute-oob="[css-selector]:add:some-other-attr=some-val"
hx-set-attribute-oob="[css-selector]:remove:disabled"
At the moment you can kind of achieve this by removing the whole element with
hx-swap
and then restoring it later when you re-render the wider page after form submission, but it would be nice to be able to (at least) set other things disabled or read-only out of band, rather than having to rebuild all the elements from fragments and include them as swaps.(Unsure about this)
Might be safer to just permit this for disabled/read-only rather than for arbitrary attributes? I don't have a strong feeling for which would be preferable, really
The text was updated successfully, but these errors were encountered: