Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-menu] Sub menu height is restricting to the parent menu height #2045

Merged
merged 7 commits into from
Mar 1, 2024

Conversation

KV106606Viswanath
Copy link
Contributor

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:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-10234


Thank you for contributing to Terra.
@cerner/terra

@KV106606Viswanath KV106606Viswanath self-assigned this 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;
Copy link
Contributor

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;;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@@ -2,6 +2,9 @@

## Unreleased

* Fixed
* Fixed menu height issue when it has more items than viewport height.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@sugan2416
Copy link
Contributor

Add examples and tests for large submenu items and also the reverse case

@KV106606Viswanath
Copy link
Contributor Author

KV106606Viswanath commented Feb 27, 2024

Add examples and tests for large submenu items and also the reverse case

Added

@github-actions github-actions bot temporarily deployed to preview-pr-2045 March 1, 2024 06:27 Destroyed
@saket2403 saket2403 merged commit 7c89c85 into main Mar 1, 2024
22 checks passed
@saket2403 saket2403 deleted the KV106606-terra-menu-height-defect branch March 1, 2024 09:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants