Skip to content

Commit

Permalink
fix(paginator): fixs from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
malegreIndec committed Dec 29, 2023
1 parent fe63628 commit 54839b8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/Pagination/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const Pagination = ({
const [search, setSearch] = useState(currentPage);
const hasArrowRight = Math.max(...pages) < totalPages;
const hasArrowLeft = Math.min(...pages) > 1;
const handleChangeInput = value => setSearch(parseInt(value, 10));

const handleChangeInput = value => { setSearch(Number(value) || "")};

const handleMoveLeft = () => {
const pagesNumbers = getPagesNumber(pages);
Expand Down Expand Up @@ -58,10 +59,8 @@ const Pagination = ({
}
};

const handleBlur = () => {
if (Number.isNaN(search)) {
setSearch(1);
}
const handleBlur = () => {
!Number.isNaN(search) && setSearch(1)
};

useEffect(() => {
Expand Down

0 comments on commit 54839b8

Please sign in to comment.