-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support hx-swap
modifiers in a type-safe way
#1
Comments
@angelofallars is there anything that is expected to change beside the headers? ( |
btw is it possible for the something like
|
Yes, with method chaining: htmx.SwapOuterHTML.FocusScroll(true).ScrollBottom() |
i see, i think the requirement is clear enough now i will create a draft PR for #1 |
@angelofallars would you mind to check the draft PR? #3 it covers the proposal on how to set modifiers but it has not covered all of the mentioned modifiers in https://htmx.org/attributes/hx-swap the remaining modifiers will be covered once we agreed with the proposal thanks! |
After some research, it turns out that HTMX supports modifier attributes in
hx-swap
. E.g.swap:1s
,settle:1s
andscroll:bottom
. https://htmx.org/attributes/hx-swap/There's a lot of possible modifier attributes, but most of them can be represented by a finite amount of values. I'd like to see an implementation that is type-safe as much as possible.
Example possible implementations:
Edit: This possible implementation looks good too, implementing methods on the
htmx.swapStrategy
type (which is just derived fromstring
) that return a newswapStrategy
value:The text was updated successfully, but these errors were encountered: