feat: added portalName
, timeoutLength
and ...rest
props
#1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
portalName
to customize thePortalHost
where popup content isplaced.
timeoutLength
to customize the delay when measuring popup content....rest
props to theView
wrapping popup content.portalName
I ran into an issue where using
Popup
in a React NativeModal
, covered the popup content. In order to work around that issue, I added a namedPortalHost
to my modal and passed that name through thePopup
component.timeoutLength
I was running into issues wher the popup content was sometimes positioning itself at 0, 0. The root issue was that the initial layout measurements were happening before the content was rendered. To solve this I wrapped that initial
measureWindow
request in a timeout similar to the existing timeout used with theDimensions
event listener. I further allowed customizing the timeout for all 3measureWindow
requests....rest
For accessibility on web, I wanted to combine Downshift.js with
Popup
. However, Downshift (and accessibility patterns on web), require Select, Tooltip, etc. contents to always be accessible in the DOM. I was mostly able to work around that by controlling theoverlay
prop. However, I also needed to configure thepointerEvents
prop of the popup content so it would not block interactions below it. To resolve this, I apply any additional props to theView
component wrapping the user's popup content.I know this is a lot of changes for a single PR but I figured it would be easier for us both to handle everything in one PR rather than multiple. Let me know if you want me to break any of these changes out or remove any of them entirely.