-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Documentartion]Add more information about other swap strategies #2889
[Documentartion]Add more information about other swap strategies #2889
Conversation
@alexpetros @Telroshan I would love to get your feedback on this documentation update. |
@MichaelWest22 Can you have a look here? |
Yeah I think you have done a good job here describing most of the issues. Maybe the alternative swap strategies section could go above the troublesome tables as I think it is more useful to learn first before the exception for wrapping tables in templates and the SVG exception. |
|
||
As mentioned previously when using swap strategies other than `true` or `outerHTML` the encapsulating tags are stripped, as such you need to excapsulate the returned data with the correct tags for the context. | ||
|
||
For a table that uses `<tbody>`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe to make it extra clear, precise here that the goal is to swap a <tr>
tag in eventually? (just like you explicitly mention <li>
and <p>
below!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have update the language lmk what you think!
That was fast, thanks 😁 |
Description
This extends the
hx-swap-oob
documentation with more information on using it with alternate swap strategies which can be finicky, all my conclusions are based on trial and error using htmx 2.0.2 on Firefox 129.More background on all the testing I did can be found in #2560
Checklist
master
for website changes,dev
forsource changes)
approved via an issue
[ ] I ran the test suite locally (npm run test
) and verified that it succeeded