mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
parent
7ce1a540bc
commit
aabbcbf41d
@ -43,6 +43,11 @@ export function useMeasure<T extends Element>() {
|
||||
const target = ref.current;
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
const bounds = target.getBoundingClientRect();
|
||||
|
||||
setMeasure(new DOMRect(0, 0, bounds.width, bounds.height));
|
||||
|
||||
const resizeObserver = new ResizeObserver((entries: any) => {
|
||||
const entry = entries[entries.length - 1];
|
||||
if (entry && entry.contentRect)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user