Skip to content

Fix pagination calculation by ensuring numeric data attributes#782

Open
ReeseWang wants to merge 1 commit into
javve:masterfrom
ReeseWang:master
Open

Fix pagination calculation by ensuring numeric data attributes#782
ReeseWang wants to merge 1 commit into
javve:masterfrom
ReeseWang:master

Conversation

@ReeseWang
Copy link
Copy Markdown

Description

Added proper type conversion for pagination-related data attributes that are retrieved as strings but need to be used as integers in calculations.

Changes

  • Added parseInt() with radix 10 to convert data-page attribute value to integer
  • Added parseInt() with radix 10 to convert data-i attribute value to integer
  • Added validation to ensure numeric values are valid before calculation

Why

Previously, the pagination calculation was using string values directly from data attributes, which could lead to incorrect results when performing arithmetic operations. This change ensures proper numeric calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant