Remove dom-helpers dependency from @react-aria/overlays#3291
Conversation
|
Build successful! 🎉 |
| function getOffset(node: Element): Offset { | ||
| let box: Offset = node.getBoundingClientRect(); | ||
| let {scrollTop, scrollLeft, clientTop, clientLeft} = document.documentElement; | ||
| box.top += scrollTop - clientTop; | ||
| box.left += scrollLeft - clientLeft; | ||
| return box; | ||
| } |
There was a problem hiding this comment.
This errors when I attempt to open a Picker in the following story: https://reactspectrum.blob.core.windows.net/reactspectrum/7c18f4284ae7f6fd19e8b8be8da8ee28e82cc2b4/storybook/index.html?path=/story/picker--default&providerSwitcher-toastPosition=bottom. Similar thing happens which other overlay components (MenuTrigger, ComboBox, etc)
| "@babel/runtime" "^7.1.2" | ||
|
|
||
| dom-helpers@^5.0.1, dom-helpers@^5.2.1: | ||
| dom-helpers@^5.0.1: |
There was a problem hiding this comment.
There was a problem hiding this comment.
Yes, react-spectrum will still have a dependency, but react-aria won't
|
Build successful! 🎉 |
snowystinger
left a comment
There was a problem hiding this comment.
looks good, more complicated examples such as offset/cross offset/different containers/different targets all seem to be working as expected
|
Build successful! 🎉 |

Reduces bundle size by ~1.8 KB.