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] Dynamic resizing of sub-menu #992
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
15d3aee
resizing
930cfa5
removed fixed height logic and menuContent calculates its height
49827f1
updating changelog
42c0620
Merge branch 'master' into terra-menu-resize-submenu
lokesh-0813 b912052
updating pageHeight logic
3a25730
Merge branch 'master' into terra-menu-resize-submenu
lokesh-0813 fde6e1b
fixed merge conflicts
9515f20
updating wdio ss and fixed typo
a87334b
updaint fusion ss
9cd8f93
Merge branch 'master' into terra-menu-resize-submenu
lokesh-0813 445d156
Merge branch 'master' into terra-menu-resize-submenu
lokesh-0813 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,10 +59,6 @@ const propTypes = { | |
* Indicates if menu's width has been constrained by bounding container. | ||
*/ | ||
isWidthBounded: PropTypes.bool, | ||
/** | ||
* Fixed height for content. | ||
*/ | ||
fixedHeight: PropTypes.number, | ||
/** | ||
* Fixed width for content. | ||
*/ | ||
|
@@ -297,7 +293,7 @@ class MenuContent extends React.Component { | |
onKeyDown, | ||
isActive, | ||
}); | ||
// If the child has children then it is an item group, so iterate through it's children | ||
// If the child has children then it is an item group, so iterate through it's children | ||
} else if (item.props.children) { | ||
const children = item.props.children ? [] : undefined; | ||
React.Children.forEach(item.props.children, (child) => { | ||
|
@@ -336,7 +332,7 @@ class MenuContent extends React.Component { | |
if (isFullScreen || isSubMenu) { | ||
header = this.buildHeader(isFullScreen); | ||
} | ||
const contentHeight = this.props.isHeightBounded ? '100%' : this.props.fixedHeight; | ||
const contentHeight = this.props.isHeightBounded && '100%'; | ||
const contentPosition = this.props.isHeightBounded ? 'relative' : 'static'; | ||
const contentWidth = this.props.isWidthBounded ? undefined : this.props.fixedWidth; | ||
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, react/forbid-dom-props */ | ||
|
@@ -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}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was the index prop used here before ? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so how we are handling this scenario now ? after removing this ? |
||
<List className={cx('list')} role="menu"> | ||
{items} | ||
</List> | ||
|
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
Binary file modified
BIN
+1.71 KB
(120%)
...io/__snapshots__/reference/en/chrome_medium/menu-spec/Menu-Bounded[submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.6 KB
(150%)
..._medium/menu-spec/Menu_Keyboard_Navigation-Arrow_Keys[navigated_to_submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.6 KB
(150%)
...e_medium/menu-spec/Menu_Keyboard_Navigation-Enter_Key[navigated_to_submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.6 KB
(150%)
...apshots__/reference/en/chrome_medium/menu-spec/Menu_with_a_submenu[submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.27 KB
(120%)
...ference/orion-fusion-theme/en/chrome_medium/menu-spec/Menu-Bounded[submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.4 KB
(150%)
..._medium/menu-spec/Menu_Keyboard_Navigation-Arrow_Keys[navigated_to_submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.4 KB
(150%)
...e_medium/menu-spec/Menu_Keyboard_Navigation-Enter_Key[navigated_to_submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.4 KB
(150%)
.../orion-fusion-theme/en/chrome_medium/menu-spec/Menu_with_a_submenu[submenu].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
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.
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?