Skip to content
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

Conversation

Keeper-of-the-Keys
Copy link
Contributor

@Keeper-of-the-Keys Keeper-of-the-Keys commented Sep 10, 2024

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

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • [ ] I ran the test suite locally (npm run test) and verified that it succeeded

@Keeper-of-the-Keys
Copy link
Contributor Author

@alexpetros @Telroshan I would love to get your feedback on this documentation update.

@Telroshan Telroshan added the documentation Improvements or additions to documentation label Sep 11, 2024
@Keeper-of-the-Keys
Copy link
Contributor Author

@MichaelWest22 Can you have a look here?

@MichaelWest22
Copy link
Contributor

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>`:
Copy link
Collaborator

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!)

Copy link
Contributor Author

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!

www/content/attributes/hx-swap-oob.md Outdated Show resolved Hide resolved
@Telroshan
Copy link
Collaborator

That was fast, thanks 😁

@Telroshan Telroshan merged commit 7f8105a into bigskysoftware:master Sep 18, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants