[Question] getBoundingClientRect delay needed?
Hi. The documentation mentions the need for a 2 frame delay when getting styles with `getComputedStyle`. My question is, does this also apply to `getBoundingClientRect` when getting the position of a DOM element?
The coherent GameUIComponents make use of `getBoundingClientRect` for navigation without any frame delays, so is it OK to skip the delay in those cases?
1
-
In my experience you need to call engine.executeImmediateLayoutSync() after setting styles if you wish to immediately re-read the resultant bounding box generated from those styles.
However, this may or may not impact your UI's performance depending on how complex it is.
1
Please sign in to leave a comment.
Comments
1 comment