Skip to content

Divs with on:click events prevent form submission #10989

Answered by david-plugge
Elsoberanold asked this question in Q&A
Discussion options

You must be logged in to vote

The click Event fires before the submit Event. In that case your dropdown closes and the Form is removed from the dom. Try to add on:click|stopPropagation to the submit button.
And also, does clicking in the Input also close the dropdown? I suggest passing down a close function using a slot prop to explicitly close the dropdown.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Elsoberanold
Comment options

@david-plugge
Comment options

@david-plugge
Comment options

@Elsoberanold
Comment options

Answer selected by Elsoberanold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants