Skip to content

Commit f4a9896

Browse files
committed
Fix SYMBOL_RECT_STATE not getting assigned
1 parent c1e97ad commit f4a9896

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ export namespace ComponentPerf {
267267
return (component as Rect | undefined)?.[SYMBOL_RECT_STATE]
268268
}
269269

270+
export namespace Rect {
271+
export function assign (component: Component, rectState: State.JIT<DOMRect>): void {
272+
(component as Rect)[SYMBOL_RECT_STATE] = rectState
273+
}
274+
}
275+
270276
export interface CallbacksOnInsertions extends Component {
271277
[SYMBOL_CALLBACKS_ON_INSERTIONS]?: (() => unknown)[]
272278
}
@@ -524,6 +530,8 @@ function Component (type?: keyof HTMLElementTagNameMap | AnyFunction, builder?:
524530
},
525531
get rect (): State.JIT<DOMRect> {
526532
const rectState = State.JIT(() => component.element.getBoundingClientRect())
533+
ComponentPerf.Rect.assign(component, rectState)
534+
527535
const oldMarkDirty = rectState.markDirty
528536
rectState.markDirty = () => {
529537
oldMarkDirty()

0 commit comments

Comments
 (0)