This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
[terra-menu] Sub menu height is restricting to the parent menu height #2045
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sugan2416
reviewed
Feb 23, 2024
@@ -187,7 +187,7 @@ class MenuContent extends React.Component { | |||
if (this.props.index > 0 && this.listNode) { | |||
const bufHeight = ((this.context.name || this.context.className) === 'orion-fusion-theme') || MenuUtils.isSafari() ? 20 : 10; | |||
const submenuHeight = this.listNode.clientHeight + this.listNode.parentNode.parentNode.parentNode.firstChild.clientHeight + bufHeight; | |||
return submenuHeight > window.innerHeight ? this.props.fixedHeight : submenuHeight; | |||
return submenuHeight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if its set to window height ?
Suggested change
return submenuHeight; | |
return submenuHeight > window.innerHeight ? window.innerHeight : submenuHeight;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
sugan2416
reviewed
Feb 23, 2024
packages/terra-menu/CHANGELOG.md
Outdated
@@ -2,6 +2,9 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Fixed | |||
* Fixed menu height issue when it has more items than viewport height. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
* Fixed menu height issue when it has more items than viewport height. | |
* Fixes sub-menu height issue when it exceeds viewport size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Add examples and tests for large submenu items and also the reverse case |
Added |
sugan2416
approved these changes
Feb 29, 2024
saket2403
approved these changes
Mar 1, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Previously, the submenu height was fixed to the main menu height when the menu items exceeded the viewport size. With this fix, the menu height now occupies the entire viewport height.
What was changed:
Removed the fixed height of the menu when menu items exceeded the viewport size.
Why it was changed:
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-10234
Thank you for contributing to Terra.
@cerner/terra