Jun 30, 2023
Ah! You'd have to create a ref, that you'd assign to the "trigger" component, and then calculate the correct position based on this ref's getBoundingClientRect results. A few of the examples in the article have this code, for example both of the dialogs here are positioned relative to the target:
https://codesandbox.io/s/escape-overflow-trap-8w8yr2?file=/src/App.tsx:709-730
Will be the same with portalled modal.