File tree Expand file tree Collapse file tree
src/app/shared/search/search-filters/search-filter/search-range-filter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 {{'search.filters.filter.' + filterConfig.name + '.min.label' | translate}}
99 </ span >
1010 < input type ="text " [(ngModel)] ="range[0] " [name] ="filterConfig.paramName + '.min' "
11- class ="form-control " (blur) =" onSubmit() "
11+ class ="form-control "
1212 [attr.aria-label] ="minLabel "
1313 [placeholder] ="minLabel "
1414 />
2020 {{'search.filters.filter.' + filterConfig.name + '.max.label' | translate}}
2121 </ span >
2222 < input type ="text " [(ngModel)] ="range[1] " [name] ="filterConfig.paramName + '.max' "
23- class ="form-control " (blur) =" onSubmit() "
23+ class ="form-control "
2424 [attr.aria-label] ="maxLabel "
2525 [placeholder] ="maxLabel "
2626 />
3333
3434 < ng-container *ngIf ="shouldShowSlider() ">
3535 < nouislider [connect] ="true " [config] ="config " [min] ="min " [max] ="max " [step] ="1 "
36- [dsDebounce] ="250 " (onDebounce) ="onSubmit() "
36+ [dsDebounce] ="250 "
37+ (change) ="onSliderChange($event) "
3738 (keydown) ="startKeyboardControl() " (keyup) ="stopKeyboardControl() "
3839 [(ngModel)] ="range " ngDefaultControl >
3940 </ nouislider >
4344 < ds-search-facet-range-option *ngFor ="let value of page.page; trackBy: trackUpdate " [filterConfig] ="filterConfig " [filterValue] ="value " [inPlaceSearch] ="inPlaceSearch "> </ ds-search-facet-range-option >
4445 </ div >
4546 </ ng-container >
47+ < button (click) ="onSubmit() " class ="btn btn-primary ">
48+ {{'search.filters.search.submit' | translate}}
49+ </ button >
4650 </ div >
4751</ div >
Original file line number Diff line number Diff line change @@ -81,6 +81,11 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple
8181 */
8282 range ;
8383
84+ /**
85+ * The range currently selected by the slider
86+ */
87+ sliderRange : [ number | undefined , number | undefined ] ;
88+
8489 /**
8590 * Subscription to unsubscribe from
8691 */
@@ -138,6 +143,15 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple
138143 } ;
139144 }
140145
146+ /**
147+ * Updates the sliderRange property with the current slider range.
148+ * This method is called whenever the slider value changes, but it does not immediately apply the changes.
149+ * @param range - The current range selected by the slider
150+ */
151+ onSliderChange ( range : [ number | undefined , number | undefined ] ) : void {
152+ this . sliderRange = range ;
153+ }
154+
141155 /**
142156 * Submits new custom range values to the range filter from the widget
143157 */
You can’t perform that action at this time.
0 commit comments