Skip to content

Commit

Permalink
Merge pull request #13711 from primefaces/issue-9013
Browse files Browse the repository at this point in the history
Fix #9013 - p-slider: Slider issue with onSlideEnd event
  • Loading branch information
cetincakiroglu committed Sep 21, 2023
2 parents 3990262 + b375f58 commit 58249c9
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

1 comment on commit 58249c9

@vercel
Copy link

@vercel vercel bot commented on 58249c9 Sep 21, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.