Skip to content

Conversation

ReeseWang
Copy link

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