Closed knpwrs closed 6 months ago
Wait a minute, I recognize this bug. It happens when there is a field with name
set to action
. I feel like I submitted a PR to fix this in the older solid start but I couldn't find that PR.
In any case, #358 fixes it.
Hmm.. I think there was a reason I wanted to use the property because of the way it resolved path. But I understand the problem. Any fix will need to be tested thoroughly.
Describe the bug
In
handleFormSubmit
it appears that somehowevt.target.action
is anHTMLButtonElement
, rather than a string.Your Example Website or App
https://gitlab.com/letschurch/lets.church/-/tree/web-solid-next/apps/web-solid-next?ref_type=heads
Steps to Reproduce the Bug or Issue
Using the
action
function as youraction
withmethod
set to'post'
can somehow causeevt.target.action
to be a button rather than a string, and the call tostartsWith
fails.Expected behavior
Using the
action
function asaction
withmethod
set topost
should always work.Screenshots or Videos
Platform
Additional context
I don't really know how this is happening. I would expect
.action
on anHTMLFormElement
to always be a string (or undefined?) but it's a button. In this case, as you can see in the screenshot above, using.getAttribute
returns the right value.I have other forms that are working just fine, I don't know what's going on with this particular form.