AVAnnotate / admin-client

Application for building AVAnnotate websites
0 stars 0 forks source link

Keep page list mounted on tab change #107

Closed camdendotlol closed 1 month ago

camdendotlol commented 1 month ago

Summary

This PR adds a new optional keepMounted property to the tab objects passed to the Tabs component. The default behavior of Radix UI's tab component is to unmount any tab that's not currently selected. Using a combination of forceMount and hidden, we can keep a component mounted in the background without showing it.

This addresses the part of #63 related to the page order state being reset when changing tabs. The issue was that the Pages tab's state was being reset to its initial state because it unmounted when the user switched to the Events tab. After setting the new keepMounted property on the Pages tab's config, the tab remains mounted and remembers its state.

netlify[bot] commented 1 month ago

Deploy Preview for avannotate-staging ready!

Name Link
Latest commit e46de8b1f23ad2678438bb7bd205dbf848c25a10
Latest deploy log https://app.netlify.com/sites/avannotate-staging/deploys/66e9d79d378522000803578e
Deploy Preview https://deploy-preview-107--avannotate-staging.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.