-
-
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
Ignore formmethod when value is "dialog" #1866
Comments
Here is my PR #1867. |
Isn't the whole point of
(source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog) With this in mind, IMO htmx should not continue the request once it detects that
|
Try this solution
|
Buttons support
dialog
as a valid value for theformmethod
attribute.MDN documentation
Given the following example:
htmx will issue a request with a method of
DIALOG
There are a couple of issues with this:
DIALOG
is not a valid request methodHere is the line of code which causes this:
htmx/src/htmx.js
Lines 2960 to 2961 in 04250d5
As
dialog
is a validformmethod
attribute, but not a valid request method, I think htmx should ignore theformmethod
in this case when creating the AJAX request.I'm going to create a PR with these changes and add some tests, but I'm more than happy to discuss further.
The text was updated successfully, but these errors were encountered: