Skip to content

fix: address validation and contributors page boundary fixes - #1949

Closed
saurabhhhcodes wants to merge 1 commit into
apu52:mainfrom
saurabhhhcodes:fix/travel-website-batch-1
Closed

fix: address validation and contributors page boundary fixes#1949
saurabhhhcodes wants to merge 1 commit into
apu52:mainfrom
saurabhhhcodes:fix/travel-website-batch-1

Conversation

@saurabhhhcodes

Copy link
Copy Markdown

Bugs fixed

1. Address validation always shows error (payment.js)

validateAddress() set a custom validity error message ("Please enter your shipping address.") even when the address was valid. Since checkValidity() considers setCustomValidity() messages, the form could never be submitted even with a correctly filled address field.

Fix: Clear custom validity with empty string when the address is valid.

2. Contributors page navigation state corruption (contributors.js)

pageNo += page was executed before the boundary check. Pressing "prev" on page 1 set pageNo to 0 internally even though the fetch was rejected and the display was not updated. Subsequent "next" clicks restored page 1 instead of advancing to page 2.

Fix: Compute the new page value first, guard against negative values, and only mutate pageNo if the new page is valid.

… in contributors.js

- payment.js: clear custom validity on valid address instead of leaving error message
- contributors.js: guard pageNo mutation before fetch so prev on page 1 doesn't corrupt state
@netlify

netlify Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploy Preview for taupe-cendol-f7e2bb ready!

Name Link
🔨 Latest commit 9ef942f
🔍 Latest deploy log https://app.netlify.com/projects/taupe-cendol-f7e2bb/deploys/6a650a60a6049f0008179862
😎 Deploy Preview https://deploy-preview-1949--taupe-cendol-f7e2bb.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

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