Skip to content

Commit

Permalink
Fix #9013 - p-slider: Slider issue with onSlideEnd event
Browse files Browse the repository at this point in the history
  • Loading branch information
gucal committed Sep 21, 2023
1 parent 4b40014 commit b375f58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/components/slider/slider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, Inject, Input, NgModule, NgZone, OnDestroy, Output, PLATFORM_ID, Renderer2, ViewChild, ViewEncapsulation } from '@angular/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Inject, Input, NgModule, NgZone, OnDestroy, Output, PLATFORM_ID, Renderer2, ViewChild, ViewEncapsulation, forwardRef } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { DomHandler } from 'primeng/dom';
import { Nullable, VoidListener } from 'primeng/ts-helpers';
Expand Down Expand Up @@ -313,6 +313,9 @@ export class Slider implements OnDestroy, ControlValueAccessor {
if (!this.sliderHandleClick) {
this.updateDomData();
this.handleChange(event);

if (this.range) this.onSlideEnd.emit({ originalEvent: event, values: this.values as number[] });
else this.onSlideEnd.emit({ originalEvent: event, value: this.value as number });
}

this.sliderHandleClick = false;
Expand Down Expand Up @@ -396,7 +399,6 @@ export class Slider implements OnDestroy, ControlValueAccessor {
}

setValueFromHandle(event: Event, handleValue: any) {
this.sliderHandleClick = false;
let newValue = this.getValueFromHandle(handleValue);

if (this.range) {
Expand Down

0 comments on commit b375f58

Please sign in to comment.