sveltekit can't handle routing links inside element with on:click|stopPropogation
#5319
Labels
documentation
Improvements or additions to documentation
p3-edge-case
SvelteKit cannot be used in an uncommon way
Describe the bug
Popular usecase - Dialog component with backdrop implemented like this:
But in this case it's impossible to use routing links inside this component. Instead it will be just regular native links with page refresh.
Reproduction
ZerdoX-x/-sveltejs-kit-5319
I placed button with incrementer so you can see if page refreshes.
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
In case you have the same code I presented above, just create another
.dialog-backdrop
next to.dialog-content
, style it properly and listen for click on backdrop. That's how I workarounded it! Maybe it will be harder or impossible if you use libraries or in some other cases. I would recommend creating link component like this:The text was updated successfully, but these errors were encountered: