Skip to content

Commit

Permalink
docs: add min and max in pagination "number" input. (#5321)
Browse files Browse the repository at this point in the history
  • Loading branch information
benluo authored Aug 3, 2024
1 parent 9370c9e commit 2fea8c2
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/react/editable-data/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/expanding/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/filters/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/full-width-table/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/fully-controlled/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/grouping/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/kitchen-sink/src/components/ActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export function ActionButtons<T extends RowData>({
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/pagination-controlled/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/pagination/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ function MyTable({
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/row-pinning/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down
2 changes: 2 additions & 0 deletions examples/react/row-selection/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ function App() {
| Go to page:
<input
type="number"
min="1"
max={table.getPageCount()}
defaultValue={table.getState().pagination.pageIndex + 1}
onChange={e => {
const page = e.target.value ? Number(e.target.value) - 1 : 0
Expand Down

0 comments on commit 2fea8c2

Please sign in to comment.