|
1 | | -29 |
2 | | - |
3 | | -user avatar |
4 | | - |
5 | | - |
6 | | - |
7 | | -15 matches |
8 | | -#28 Ensure all forms are usable with mobile keyboards |
| 1 | +Add useCallback for event handlers in dashboard and settings |
9 | 2 | Repo Avatar |
10 | 3 | Betta-Pay/BettaPay-Frontend |
11 | | -Description: When mobile keyboards are open, form fields can be hidden behind the keyboard. The login, register, payment link creation, and settings forms need to be scrollable and the active input should remain visible above the keyboard. |
| 4 | +Description: Inline functions passed as props (e.g., onClick, onChange, handleCopy) create new function references on every render, causing child components to re-render even with React.memo. Wrapping these in useCallback stabilizes the references. |
12 | 5 |
|
13 | 6 | Requirements: |
14 | 7 |
|
15 | | -Form containers should be within a scrollable area |
16 | | -The or form wrapper should not have overflow: hidden that prevents scrolling to the focused input |
17 | | -Test all forms with a mobile keyboard open (use Chrome DevTools device emulation) |
18 | | -Ensure the submit button is reachable without scrolling excessively |
| 8 | +Wrap handleCopy, handleLogout, onSubmit, and other handlers in useCallback |
| 9 | +Include correct dependency arrays |
| 10 | +Apply across all pages with interactive elements |
19 | 11 | Suggested execution steps: |
20 | 12 |
|
21 | | -Review all form pages and verify the scroll behavior with keyboard open |
22 | | -In app/auth/layout.tsx, ensure the form column uses overflow-y: auto not overflow: hidden |
23 | | -Add scroll-margin-bottom: 200px to form submit buttons so they scroll above the keyboard |
24 | | -Test the settings page form fields (business info, security) with keyboard open |
25 | | -Test the payment link creation dialog — dialogs can be problematic with mobile keyboards |
| 13 | +In app/(merchant)/dashboard/page.tsx, wrap handleCopy and the period toggle handler in useCallback |
| 14 | +In app/(merchant)/settings/page.tsx, wrap handleLogout and tab change handlers |
| 15 | +In app/auth/login/page.tsx, wrap onSubmit and onWalletConnected |
| 16 | +In components/layout/Topbar.tsx, wrap handleLogout |
| 17 | +Use React DevTools Profiler to verify fewer re-renders |
0 commit comments