Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(APT-1610): add portalEl prop to Combobox #1233

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

chasingmaxwell
Copy link
Contributor

@chasingmaxwell chasingmaxwell commented Apr 22, 2024

This utilizes createPortal to allow space/position constrained implementations of Combobox to render the dropdown menu in another component so the positioning of the menu is not dependent on the parent element.

In BulkUploader we need this functionality to prevent menus from being hidden behind table headers:

before: (because the dropdown menu could not be displayed outside the bounds of the table, popperjs positioned the menu on top, but it was hidden under the sticky header and couldn't be positioned above it because of the positioning of virtualized rows)
image

after: (using the portalEl prop we can render the dropdown menu as a child of document.body which allows popper to position it below and allow it to extend outside the boundary of the table regardless of the positioning of its parent row)
image

Copy link

kermitapp bot commented Apr 22, 2024

@bryan-ash
Copy link
Member

It would be super helpful if you could add a story to the storybook, and drop a screenshot in the PR description.

This allows space/position constrained implementations of combobox to render the dropdown menu in another component so the positioning of the menu is not dependent on the parent element.
@chasingmaxwell chasingmaxwell force-pushed the APT-1610-combobox-portal branch from 5b04ed0 to 363c7d6 Compare April 23, 2024 20:54
@chasingmaxwell
Copy link
Contributor Author

@bryan-ash I've added a story and screenshots to the PR description. Thanks!

Copy link
Contributor

Released prerelease version 8.11.3-APT-1610-combobox-portal-bb171f6.0.
You may now run npm install @appfolio/react-gears@APT-1610-combobox-portal

Copy link
Member

@bryan-ash bryan-ash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☀️

@chasingmaxwell chasingmaxwell merged commit ebdacbc into master Apr 23, 2024
4 checks passed
@chasingmaxwell chasingmaxwell deleted the APT-1610-combobox-portal branch April 23, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants