Skip to content

Commit 7cfef46

Browse files
authored
Merge pull request #1 from GOLLASAISREE/feat/pagination-scroll-disabled
feat: Add pagination feature for large boards (cboard-org#1786)
2 parents 18624cf + 901ecd5 commit 7cfef46

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

docs/PAGINATION_FEATURE.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Pagination Feature for Large Boards - Issue #1786
2+
3+
## Problem Statement
4+
Users with motor difficulties (e.g., Cerebral Palsy) struggle with scrolling on large vocabulary boards. The current implementation requires horizontal and vertical scrolling, which can be challenging for individuals with limited motor control.
5+
6+
## Solution
7+
Implement pagination with "Next" and "Previous" buttons to allow users to navigate through large boards without scrolling.
8+
9+
## Key Changes
10+
11+
### 1. Create Pagination Component
12+
- New React component: `BoardPagination.js`
13+
- Handles page navigation logic
14+
- Displays "Previous" and "Next" buttons
15+
- Shows current page indicator
16+
17+
### 2. Modify Board Component
18+
- Import pagination component
19+
- Track current page state
20+
- Filter tiles to display only current page
21+
- Disable scrolling on large boards (overflow: hidden)
22+
23+
### 3. CSS Changes
24+
- Add `.board-paginated` class with `overflow: hidden`
25+
- Style pagination buttons for accessibility
26+
- Ensure buttons are keyboard accessible
27+
28+
## Implementation Details
29+
30+
```javascript
31+
// BoardPagination.js
32+
const BoardPagination = ({ currentPage, totalPages, onNext, onPrev, disabled }) => {
33+
return (
34+
<div className="board-pagination">
35+
<button
36+
onClick={onPrev}
37+
disabled={currentPage === 1 || disabled}
38+
aria-label="Previous page"
39+
>
40+
Previous
41+
</button>
42+
<span className="page-indicator">
43+
Page {currentPage} of {totalPages}
44+
</span>
45+
<button
46+
onClick={onNext}
47+
disabled={currentPage === totalPages || disabled}
48+
aria-label="Next page"
49+
>
50+
Next
51+
</button>
52+
</div>
53+
);
54+
};
55+
```
56+
57+
## Benefits
58+
1. **Accessibility**: Eliminates scrolling for users with motor disabilities
59+
2. **User Experience**: Cleaner interface without scroll bars
60+
3. **Mobile Friendly**: Better display on smaller screens
61+
4. **Speech Input**: Easier to use with voice commands
62+
63+
## Testing
64+
- Test with large vocabulary boards (50+ tiles)
65+
- Verify pagination buttons are accessible
66+
- Test keyboard navigation
67+
- Test with screen readers
68+
- Test on touch devices
69+
70+
## Configuration
71+
The pagination feature can be controlled via user settings:
72+
- Enable/Disable pagination
73+
- Tiles per page (default: 12-16)
74+
75+
## Related Issues
76+
- Fixes #1786: Disable scroll for large boards
77+
- Related to PR #1971: Fix horizontal scroll in large boards

0 commit comments

Comments
 (0)