From 09531d85addc9880c58d7591853322a1d036e91e Mon Sep 17 00:00:00 2001 From: Bryan Valverde U Date: Thu, 24 Oct 2024 15:45:08 -0600 Subject: [PATCH] Fix ZoomScaleChangedEvent no longer being triggered in EditorAdapter #2843 --- .../lib/editor/EditorAdapter.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/roosterjs-editor-adapter/lib/editor/EditorAdapter.ts b/packages/roosterjs-editor-adapter/lib/editor/EditorAdapter.ts index cc9f977ce6a..b80589167e9 100644 --- a/packages/roosterjs-editor-adapter/lib/editor/EditorAdapter.ts +++ b/packages/roosterjs-editor-adapter/lib/editor/EditorAdapter.ts @@ -1093,17 +1093,13 @@ export class EditorAdapter extends Editor implements ILegacyEditor { */ setZoomScale(scale: number): void { if (scale > 0 && scale <= 10) { - const oldValue = this.getZoomScale(); - - if (oldValue != scale) { - this.triggerEvent( - 'zoomChanged', - { - newZoomScale: scale, - }, - true /*broadcast*/ - ); - } + this.triggerEvent( + 'zoomChanged', + { + newZoomScale: scale, + }, + true /*broadcast*/ + ); } }