Hover to expand topology option if the list exceeds the max width

This commit is contained in:
Yu Cao
2018-03-22 12:07:38 -04:00
parent 5f8da6d077
commit e3737dcb27
2 changed files with 27 additions and 9 deletions

View File

@@ -101,6 +101,15 @@ class TopologyOptions extends React.Component {
return (
<div className="topology-option" key={optionId}>
<div className="topology-option-wrapper">
{option.get('selectType') === 'union' &&
<TopologyOptionAction
onClick={this.handleNoneClick}
optionId={optionId}
item={noneItem}
topologyId={currentTopologyId}
activeValue={activeValue}
/>
}
{option.get('options').map(item => (
<TopologyOptionAction
onClick={this.handleOptionClick}
@@ -111,15 +120,6 @@ class TopologyOptions extends React.Component {
item={item}
/>
))}
{option.get('selectType') === 'union' &&
<TopologyOptionAction
onClick={this.handleNoneClick}
optionId={optionId}
item={noneItem}
topologyId={currentTopologyId}
activeValue={activeValue}
/>
}
</div>
</div>
);

View File

@@ -1554,6 +1554,23 @@ a {
}
.topology-option {
&-wrapper {
display: inline-flex;
flex-wrap: wrap;
overflow: hidden;
max-height: 27px;
transition: max-height 0.5s 0s $base-ease;
&:hover {
height: auto;
max-height: calc((13px * 1.5 + 3px + 3px) * 8); // expand to display 8 rows
overflow: auto;
transition: max-height 0.5s 0s $base-ease;
}
.topology-option-action {
flex: 1 1 auto;
text-align: center;
}
}
&-action {
&-selected {
cursor: default;
@@ -1619,6 +1636,7 @@ a {
border-radius: 8px;
border: 1px solid transparent;
pointer-events: none;
max-width: 50%;
}
.sidebar-gridmode {