Skip to content

Fix/price range validation#92

Open
Nandha-Kumar-cs wants to merge 13 commits into
hitesh-kumar123:mainfrom
Nandha-Kumar-cs:fix/price-range-validation
Open

Fix/price range validation#92
Nandha-Kumar-cs wants to merge 13 commits into
hitesh-kumar123:mainfrom
Nandha-Kumar-cs:fix/price-range-validation

Conversation

@Nandha-Kumar-cs

Copy link
Copy Markdown
Contributor

Description

Add price range validation

Related issue

Closes #26

How to test

  1. Navigate to the Listing page
  2. Open the Filters panel
  3. In the Price filter:
    • Enter a value below the minimum allowed in the Min Price field
    • OR enter a value above the maximum allowed in the Max Price field
  4. Move focus out of the input (blur)
  5. Verify:
    • The input shows error styling and shake animation
    • The invalid value is cleared
  6. Enter valid values within the allowed range
  7. Verify:
    • No error is shown
    • Filters apply correctly

Happy to make any requested changes.

@netlify

netlify Bot commented Jan 10, 2026

Copy link
Copy Markdown

Deploy Preview for smartrentsystem ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ae11697
🔍 Latest deploy log https://app.netlify.com/projects/smartrentsystem/deploys/69678f0f765e6300083783d5
😎 Deploy Preview https://deploy-preview-92--smartrentsystem.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.

@hitesh-kumar123

Copy link
Copy Markdown
Owner

add before and after image and follow pr template after i will merge pr

@Nandha-Kumar-cs

Copy link
Copy Markdown
Contributor Author

🐞 Issue Description (Before Fix)

Problem:
The price range input validation was missing proper checks.
Impact:
This allows invalid price ranges, which can lead to incorrect filtering and poor user experience.

🎥 Before Fix Video:

before.mp4

✅ Fix Description (After Fix)

Solution Implemented:

  • Added validation to prevent negative price values.
  • Added validation to ensure minimum price cannot be greater than maximum price.
    Result
  • Users can only enter valid price ranges.
  • Improves data integrity and user experience.

🎥 After Fix Video:
after_trimmed.webm

@hitesh-kumar123
Happy to make any requested changes.

@hitesh-kumar123

Copy link
Copy Markdown
Owner

resolve conflicts

@Harsh63870 Harsh63870 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do see these issues:
Don’t mutate state in checkInput (filters.priceMin/priceMax). Use setFilters and convert inputs to Number.
Fix string/number comparisons and show validation longer than 300ms (or keep persistent until corrected).
Remove no-op debug forEach blocks.
Verify category-scroller UI changes and ensure .range-input-error CSS exists.

@Harsh63870 Harsh63870 added the SWoC26 Issues and tasks related to Social Winter of Code (SWoC) contributions. label Jan 13, 2026
@hitesh-kumar123

Copy link
Copy Markdown
Owner

@Nandha-Kumar-cs please follow issue template update create issue according issues template i have not understand what you contribute in my project after make pr i am not satisfied and not meaningful contributions i canceled your pull request

@Nandha-Kumar-cs

Copy link
Copy Markdown
Contributor Author

@hitesh-kumar123
Thank you for the feedback. I apologize for not following the issue template and for the confusion caused by my pull request.

This is my first open-source contribution, and I’m still learning the correct process. I understand now that my contribution was not aligned with your project’s expectations.

I’ll make sure to follow the issue template properly and contribute more meaningfully in the future.

@Harsh63870 Harsh63870 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heyy
in the checkInput you do filters.priceMin = "" / filters.priceMax = "". that mutates state directly and will cause inconsistent UI and bugs....
multiple leftover forEach(() => {}) and empty blocks....
comparisons like value < PRICE_MIN or value > filters.priceMax are unsafe (string vs number) and will produce incorrect result...

@Nandha-Kumar-cs

Nandha-Kumar-cs commented Jan 14, 2026

Copy link
Copy Markdown
Contributor Author

@Harsh63870
I accidentally clicked re-request review while reviewing, that was unintentional. I’m currently fixing the issues by:

  • Replacing direct mutations with setFilters(prev => …)
  • Converting input values to Number before comparisons
    I’ll push an updated commit shortly.

@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for smartrentsystem ready!

Name Link
🔨 Latest commit 62db985
🔍 Latest deploy log https://app.netlify.com/projects/smartrentsystem/deploys/6a391f837ded320009c0f245
😎 Deploy Preview https://deploy-preview-92--smartrentsystem.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.

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

Labels

SWoC26 Issues and tasks related to Social Winter of Code (SWoC) contributions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Price filter accepts negative values in min/max fields

3 participants