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

[terra-menu] Dynamic resizing of sub-menu #992

Closed
wants to merge 11 commits into from

Conversation

lokesh-0813
Copy link
Contributor

fixes : #952

@lokesh-0813 lokesh-0813 self-assigned this Dec 18, 2019
@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 December 18, 2019 11:57 Inactive
@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 December 18, 2019 12:01 Inactive
@lokesh-0813
Copy link
Contributor Author

Dynamic resizing can be seen in this test example.

Let me know your thoughts @jmsv6d @StephenEsser

@@ -146,6 +143,13 @@ class MenuContent extends React.Component {
}
}

setPageHeight(node) {
Copy link
Contributor

@jmsv6d jmsv6d Dec 18, 2019

Choose a reason for hiding this comment

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

You shouldn't need to do this calculation. Popup should handle this without setting an explicit height on the content. You can change this https://github.com/cerner/terra-framework/pull/992/files#diff-8821ddb6189a1accf05f7aef26338373R344 to be
const contentHeight = this.props.isHeightBounded && '100%' ;
And update the content container's fill prop to be just this.props.isHeightBounded

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 here b912052

@jmsv6d
Copy link
Contributor

jmsv6d commented Dec 18, 2019

SubmenuResize

Is this acceptable behavior? @neilpfeiffer

@StephenEsser StephenEsser changed the title [terra-menu]Dynamic resizing of sub-menu [terra-menu] Dynamic resizing of sub-menu Dec 18, 2019
@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 December 19, 2019 12:22 Inactive
@lokesh-0813 lokesh-0813 marked this pull request as ready for review January 7, 2020 05:18
@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 January 7, 2020 05:19 Inactive
<Menu.Item text="Default 3.0" key="3.0" className="TestNestedMenuContent" />,
<Menu.Item text="Default 3.1" key="3.1" className="TestNestedMenuContent" />,
<Menu.Item text="Default 3.2" key="3.2" className="TestNestedMenuContent" />,
<Menu.Item text="Default 3.1" key="3.3" className="TestNestedMenuContent" />,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It should be Default 3.3 instead of 3.1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed here 9515f20

@nramamurth
Copy link
Contributor

@lokesh-0813 Are there no wdio screenshots that need to be updated with this change? If not, then I'd recommend adding one.

@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 January 8, 2020 10:42 Inactive
@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 January 11, 2020 08:53 Inactive
@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 January 11, 2020 08:59 Inactive
@lokesh-0813
Copy link
Contributor Author

@lokesh-0813 Are there no wdio screenshots that need to be updated with this change? If not, then I'd recommend adding one.

Updated here 9515f20 and here a87334b

@@ -3,6 +3,8 @@ Changelog

Unreleased
----------
### Changed
* Removed fixedHeight logic from Menu.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we update this descriptions o it's meaningful to users? Maybe something like we removed the fix height in sub-menus or we allow sub-menu's height to be determined by it's content?

@emilyrohrbough
Copy link
Contributor

@lokesh-0813 I am noticing different behavior of bound menus when the sub-menu is clicked. It seems the sub-menu is not longer bound. Here is a gif of the behavior seen in the deployment vs the existing behaviors found on https://engineering.cerner.com/terra-framework/tests/terra-menu/menu/menu/bounded-menu.

@mjhenkes mjhenkes temporarily deployed to terra-framework-deploye-pr-992 January 14, 2020 07:51 Inactive
@lokesh-0813
Copy link
Contributor Author

lokesh-0813 commented Jan 14, 2020

@lokesh-0813 I am noticing different behavior of bound menus when the sub-menu is clicked. It seems the sub-menu is not longer bound. Here is a gif of the behavior seen in the deployment vs the existing behaviors found on https://engineering.cerner.com/terra-framework/tests/terra-menu/menu/menu/bounded-menu.

@emilyrohrbough It's expected, since sub-menu has lesser menu-items compared to main-menu menu-items. Now sub-menu determines its height based on the number of menu-items it possess.

I have tweaked the Bounded Menu example(removed main-menu items and added more sub-menu items) to give you an idea of what's going on ->

Existing behaviour(master Branch)
currenttweak

Deployment behaviour
deploymenttweak

@emilyrohrbough
Copy link
Contributor

@emilyrohrbough It's expected, since sub-menu has lesser menu-items compared to main-menu menu-items. Now sub-menu determines its height based on the number of menu-items it possess.

I thought a bounded menu's height was determined by i's parent container, not its contents. Is that not the case?

@@ -350,7 +346,7 @@ class MenuContent extends React.Component {
role="dialog"
onKeyDown={this.onKeyDown}
>
<ContentContainer header={header} fill={this.props.isHeightBounded || this.props.index > 0}>
<ContentContainer header={header} fill={this.props.isHeightBounded}>
Copy link
Contributor

Choose a reason for hiding this comment

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

why was the index prop used here before ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

index > 0 would imply that it is sub-menu that is being rendered.

Copy link
Contributor

Choose a reason for hiding this comment

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

so how we are handling this scenario now ? after removing this ?

@lokesh-0813
Copy link
Contributor Author

@emilyrohrbough It's expected, since sub-menu has lesser menu-items compared to main-menu menu-items. Now sub-menu determines its height based on the number of menu-items it possess.

I thought a bounded menu's height was determined by i's parent container, not its contents. Is that not the case?

cc : @neilpfeiffer

@jmsv6d
Copy link
Contributor

jmsv6d commented Jan 30, 2020

@emilyrohrbough A menu/popup is "bounded" depending on if the height or width is greater than that of the bounding container. With the menu having a dynamic height, the state of if it's bounded or not can change. This is how I would expect this to work for this situation, I don't think there is an efficient way to get around it, especially for the reverse situation that @lokesh-0813 showed. But it's one of the visual oddities that we should have ux verify if it's acceptable, to determine if this is the actual approach we want to take to fix the original issue of if the submenu is much larger than the main menu, the submenu can end up with a very small scrollable area.

@neilpfeiffer neilpfeiffer self-assigned this Feb 4, 2020
@mjhenkes mjhenkes temporarily deployed to terra-framew-terra-menu-usiwvt May 5, 2020 19:16 Inactive
@mjhenkes
Copy link
Contributor

mjhenkes commented Jun 2, 2020

Closing until we identify the appropriate solution on the parent issue: #952

@mjhenkes mjhenkes closed this Jun 2, 2020
@xenoworf xenoworf deleted the terra-menu-resize-submenu branch February 15, 2022 17:57
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.

[Spike] [terra-menu] - Investigate Allowing Submenu Resizing
8 participants