-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
Description
Spaniel v2.4.6 does not provide support for elements being watched that are not within the DOM. Currently the ElementScheduler caches getBoundingClientRect which is set during the watch phase. Elements not yet within the DOM return default values on getBoundingClientRect which are then cached within the ElementScheduler.
spaniel/src/metal/scheduler.ts
Lines 176 to 188 in f2c580b
| watch(el: Element, callback: (frame: FrameInterface, id: string, clientRect?: ClientRect) => void, id?: string): string { | |
| this.startTicking(); | |
| id = id || generateToken(); | |
| let clientRect = el.getBoundingClientRect(); | |
| this.queue.push({ | |
| el, | |
| callback, | |
| id, | |
| clientRect | |
| }); | |
| return id; | |
| } |
Thoughts on exposing a method within Spaniel to force a revalidation of cached getBoundingClientRect on elements being watched? Either on the Watcher or exposing the W (window proxy).
Reactions are currently unavailable