Browse Source
feat(ui): implement browser back button support for question sheets
feat(ui): implement browser back button support for question sheets
Enhance the user experience by allowing the browser's back button to close active question sheets instead of navigating away from the page. - Update `useSheetScrollLock` to manage history state using `pushState` - Implement `popstate` event listener to trigger `onBack` callback - Add support for an optional `onBack` option in the scroll lock hook - Clean up redundant CSS rules related to `question-sheet-open` - Add integration tests to verify sheet closure on `popstate` eventsDev
7 changed files with 77 additions and 43 deletions
-
35src/app/globals.css
-
4src/components/Componentes/question-birthplace.tsx
-
4src/components/Componentes/question-date-sheet.tsx
-
2src/components/Componentes/question-phone.tsx
-
31src/components/Componentes/question-sheet.test.tsx
-
2src/components/Componentes/question-sheet.tsx
-
42src/components/Componentes/use-sheet-scroll-lock.ts
Write
Preview
Loading…
Cancel
Save
Reference in new issue