bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
38.67k stars 1.32k forks source link

ajax helper with no source or target defaults to body #2948

Closed MichaelWest22 closed 1 month ago

MichaelWest22 commented 1 month ago

Description

recent change #2878 has caused the default behavior of the ajax helper function for when no source or target is supplied to change to error on a target error instead of targeting body as it should do by default. The recent fix was put in to handle situations where an invalid source or target were supplied which would previously fall back to targeting body in error but the logic for that fix did not handle the case where nothing is supplied for source or target.

Corresponding issue:

2945

Testing

Added test for when both source and target not set to make sure it targets body as expected

Checklist