hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.28k stars 288 forks source link

Tabbar Sveltekit beforeNavigate #585

Open alexvdvalk opened 1 year ago

alexvdvalk commented 1 year ago

Describe the bug TabBar with urls updates the active tab even if navigation is cancelled

To Reproduce

  1. Create a tab bar with 2 tabs URLS
  2. in Tab1, create a "beforeNavigate" (native sveltekit interceptor) and add a window.confirm in the beforeNavigate function.
  3. Click on tab2 and view the window.confirm dialog
  4. Click cancel button
  5. The TabBar still indicates that Tab2 is now active, but tab1 content remains on the screen and the URL still indicates that the user is on Tab1.

Expected behavior If the navigation is cancelled, the initial tab should remain active.

Screenshots

https://user-images.githubusercontent.com/21194068/231432779-a113a650-9907-47a0-bb57-21095f6ac662.mov

Desktop (please complete the following information):

Additional context Added a demo recording. All data in this recording is fake / demo data.