Skip to content

Commit 02797c1

Browse files
committed
feat(virtual): add element keys to measure height of wekmap
1 parent d4a3d49 commit 02797c1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/heavy-icons-share.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'slate-angular': patch
3+
---
4+
5+
add element keys to measure height of wekmap

packages/src/components/editable/editable.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ import { VirtualScrollDebugOverlay } from './debug';
7070

7171
export const JUST_NOW_UPDATED_VIRTUAL_VIEW = new WeakMap<AngularEditor, boolean>();
7272

73+
export const ELEMENT_KEY_TO_HEIGHTS = new WeakMap<AngularEditor, Map<string, number>>();
74+
7375
// not correctly clipboardData on beforeinput
7476
const forceOnDOMPaste = IS_SAFARI;
7577

@@ -220,6 +222,7 @@ export class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChe
220222
NODE_TO_ELEMENT.set(this.editor, this.elementRef.nativeElement);
221223
ELEMENT_TO_NODE.set(this.elementRef.nativeElement, this.editor);
222224
IS_READ_ONLY.set(this.editor, this.readonly);
225+
ELEMENT_KEY_TO_HEIGHTS.set(this.editor, this.measuredHeights);
223226
EDITOR_TO_ON_CHANGE.set(this.editor, () => {
224227
this.ngZone.run(() => {
225228
this.onChange();

0 commit comments

Comments
 (0)