Skip to content

Commit

Permalink
fix(ngx-splitter): fix wrong value on event
Browse files Browse the repository at this point in the history
  • Loading branch information
vapkse committed Jul 15, 2024
1 parent c0426f3 commit f17fd8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/splitter/src/splitter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export class SplitterComponent extends Destroy {
const diffInPixels = startPos - pos;
const areaSizeInPixelsA = startSizeInPixelsA - diffInPixels;
const areaSizeInPixelsB = startSizeInPixelsB + diffInPixels;
areaA.size = Math.min(100, Math.max(0, 100 * areaSizeInPixelsA / containerSizeInPixels));
const areaSizeInPercentA = areaA.size = Math.min(100, Math.max(0, 100 * areaSizeInPixelsA / containerSizeInPixels));
areaB.size = Math.min(100, Math.max(0, 100 * areaSizeInPixelsB / containerSizeInPixels));
const percentWithTwoDigits = Math.round(areaA.size * 100) / 100;
const percentWithTwoDigits = Math.round(areaSizeInPercentA * 100) / 100;
this.dragProgress.emit(percentWithTwoDigits);
}),
takeUntil(stopDragging$)
Expand Down

0 comments on commit f17fd8a

Please sign in to comment.