Closed gornostay25 closed 2 years ago
This is a part of my code This code is on the "/orders" page
{#each orders as item} <tr on:click={e=>router.goto("/order/"+encodeURIComponent(item._id))}> <td>{@html badge((item.status==0)?"new":(item.status==1)?"success":"fail")}</td> <td><a href="/client/{encodeURIComponent(item.client._id)}">{item.client.name}</a></td> <td>{new Intl.NumberFormat('sr', { style: 'currency', currency: 'EUR' }).format(item.total)}</td> </tr> {/each}
When I click on the "tr" element all is well I am redirected to /order/blabla and when I press the button back in the browser, I return to the /orders page But if I use link, and after it press back button i redirected to /order/blabla
Maybe it is because both clicks (tr and anchor) are handled when you clicking on link. Try self modifier with tr handler: on:click|self={...}
self
tr
on:click|self={...}
This is a part of my code This code is on the "/orders" page
When I click on the "tr" element all is well I am redirected to /order/blabla and when I press the button back in the browser, I return to the /orders page But if I use link, and after it press back button i redirected to /order/blabla