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

fix(app): Fix dropdown menu open direction issue #15091

Merged
merged 5 commits into from
May 8, 2024

Conversation

koji
Copy link
Contributor

@koji koji commented May 4, 2024

Overview

add open direction to dropdown menu
close RQA-2662

Test Plan

run RTP protocol and try to open dropdown menus

Changelog

Review requests

Risk assessment

low

add a function to detect the open direction for dropdown menu

close RQA-
@koji koji changed the base branch from edge to chore_release-7.3.0 May 4, 2024 05:41
@koji koji added the authorship label May 6, 2024
@koji koji changed the title Fix dropdown menu open direction issue fix(app): Fix dropdown menu open direction issue May 6, 2024
@koji koji requested review from ncdiehl11 and jerader May 6, 2024 21:14
@koji koji marked this pull request as ready for review May 6, 2024 21:18
@koji koji requested a review from a team as a code owner May 6, 2024 21:18
@koji koji removed the request for review from a team May 6, 2024 21:18
window.removeEventListener('resize', handlePositionCalculation)
window.removeEventListener('scroll', handlePositionCalculation)
}
}, [filterOptions.length])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good but I think we may want to change the dependency array to include the available height? In testing, I zoomed such that the menu should pop up on top and it looks good. But then, if you zoom out such that there is room for the menu to pop up on bottom, it still pops up on top.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added window.innerHeight since availableHeight is a local var but windw.innerHeight change has an impact on the calc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the intuition about grabbing the grandparent element is correct, but the grandparent implementation in the use of the dropdown menu is not the whole slideout
Screenshot 2024-05-07 at 2 22 32 PM
Maybe we can have an optional container reference to pass into DropdownMenu and default to that if it is not undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about this?

 setDropdownPosition(
          dropdownBottom > availableHeight &&
            window.innerHeight < availableHeight
            ? 'top'
            : 'bottom'
        )

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is almost perfect except we are not accounting for the footer
Screenshot 2024-05-07 at 5 24 12 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ncdiehl11
updated. thank you for your help!

@koji koji requested a review from ncdiehl11 May 7, 2024 21:43
Copy link
Collaborator

@ncdiehl11 ncdiehl11 left a comment

Choose a reason for hiding this comment

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

working as expected 🤝

@koji koji merged commit 1be30f7 into chore_release-7.3.0 May 8, 2024
20 checks passed
@koji koji deleted the fix_dropdown-menu-open-direction-issue branch July 4, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants