Implement offsetWidth and offsetHeight

Summary:
These can just be derived from `getBoundingClientRect`. The only difference is that they're always integers (so we do we rounding manually in JS).

They're implemented as defined in  as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44512595

fbshipit-source-id: 0d994135efbb77740a06ea37eb1e6aeddde1af6e
This commit is contained in:
Rubén Norte authored and Facebook GitHub Bot committed 2023-04-13 09:19:00 -07:00
1 parent 245c405bd6
commit 6b2596d187
1 file changed
+2 -2
@@ -55,7 +55,7 @@ export default class ReactNativeElement
}
get offsetHeight(): number {
throw new TypeError('Unimplemented');
return Math.round(this.getBoundingClientRect().height);
}
get offsetLeft(): number {
@@ -71,7 +71,7 @@ export default class ReactNativeElement
}
get offsetWidth(): number {
throw new TypeError('Unimplemented');
return Math.round(this.getBoundingClientRect().width);
}
/**