Skip to content

Conversation

@iamibrahimriaz
Copy link
Collaborator

@iamibrahimriaz iamibrahimriaz commented Nov 6, 2025

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

This PR fixes an issue where the range slider in the instant search sidebar was triggering search requests continuously while dragging, instead of waiting until the user released the mouse.

Before:

  1. User clicks and starts dragging the range slider
  2. Search triggers immediately and continuously during drag
  3. Multiple AJAX requests fire (10-20+ requests per drag)
  4. Poor user experience - results update while still adjusting
  5. Unnecessary server load

After:

  1. User clicks and drags the range slider
  2. Visual values update in real-time (good UX)
  3. No search triggers during drag
  4. User releases mouse/touch
  5. Search executes once with final values

Technical Changes

File: assets/src/js/public/search-form.js

// Here is the changes
slider.directoristCustomRangeSlider?.on('update', function (values, handle) {
    if (sliderRangeValue) {
        sliderRangeValue.setAttribute('value', rangeValue);
        ❌ Removed - trigger('change') from here
    }
});

// ✅ Added this code 
slider.directoristCustomRangeSlider?.on('end', function () {
    if (sliderRangeValue && !rangeInitLoad) {
        $(sliderRangeValue).trigger('change'); 
    }
});

Additional Task

Also Fixed multiple range slider conflict issue - https://taiga-sovware-u10698.vm.elestio.app/project/directorist/issue/2195

Before:

After:

Any linked issues

Fixes #2581

Checklist

@Armanul46 Armanul46 added this to the v8.5.3 milestone Nov 10, 2025
@RabbiIslamRony RabbiIslamRony self-requested a review November 10, 2025 09:33
Copy link
Member

@RabbiIslamRony RabbiIslamRony left a comment

Choose a reason for hiding this comment

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

Looks Good

@Armanul46 Armanul46 modified the milestones: v8.5.3, v8.5.4 Dec 1, 2025
@Armanul46 Armanul46 merged commit a0cf2ff into sovware:development Dec 14, 2025
1 check passed
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.

3 participants