Closed SarguelUnda closed 6 months ago
Hello, it seems that the action always resolve on form submit even when prevent default is used.
https://github.com/SarguelUnda/solidrouter-action-issue
As a user, I expect the action to only resolve if the the submit event goes through
No response
relevant part of the code:
const [count, setCount] = createSignal(0) const myAction = action(async (data: FormData) => { setCount(c => c + 1) console.log("ACTION") }); const mySubmit = (e: SubmitEvent) => { console.log("onSubmit") e.preventDefault() } const MyForm = () => <> <form action="https://www.solidjs.com/" onSubmit={mySubmit} method="post"> <button type="submit">Click Me</button> </form> <form action={myAction} onSubmit={mySubmit} method="post"> <button type="submit">Click Me</button> </form> I should always stay at 0 : {count()} </> const App = () => { return <Router> <Route path="*" component={MyForm} /> </Router> }
Describe the bug
Hello, it seems that the action always resolve on form submit even when prevent default is used.
Your Example Website or App
https://github.com/SarguelUnda/solidrouter-action-issue
Steps to Reproduce the Bug or Issue
Expected behavior
As a user, I expect the action to only resolve if the the submit event goes through
Screenshots or Videos
No response
Platform
Additional context
relevant part of the code: