Skip to content

Commit

Permalink
Adding scroll bar to handle overflow of long network lists (#12706)
Browse files Browse the repository at this point in the history
* Adding scroll bar to handle overflow of long network lists

* set scroll property to auto

* Add margin below scrollable network list
  • Loading branch information
danjm authored Nov 15, 2021
1 parent 2ced3a8 commit c84604b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
27 changes: 15 additions & 12 deletions ui/components/app/dropdowns/network-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,20 +338,23 @@ class NetworkDropdown extends Component {
</div>
) : null}
</div>
{this.renderNetworkEntry('mainnet')}

{this.renderCustomRpcList(rpcListDetail, this.props.provider)}
<div className="network-dropdown-list">
{this.renderNetworkEntry('mainnet')}

<div
className={classnames('network-dropdown-testnets', {
'network-dropdown-testnets--no-visibility': !shouldShowTestNetworks,
})}
>
{this.renderNetworkEntry('ropsten')}
{this.renderNetworkEntry('kovan')}
{this.renderNetworkEntry('rinkeby')}
{this.renderNetworkEntry('goerli')}
{this.renderNetworkEntry('localhost')}
{this.renderCustomRpcList(rpcListDetail, this.props.provider)}

<div
className={classnames('network-dropdown-testnets', {
'network-dropdown-testnets--no-visibility': !shouldShowTestNetworks,
})}
>
{this.renderNetworkEntry('ropsten')}
{this.renderNetworkEntry('kovan')}
{this.renderNetworkEntry('rinkeby')}
{this.renderNetworkEntry('goerli')}
{this.renderNetworkEntry('localhost')}
</div>
</div>

{this.renderAddCustomButton()}
Expand Down
6 changes: 6 additions & 0 deletions ui/css/itcss/components/network.scss
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@
width: 100%;
}

.network-dropdown-list {
max-height: 330px;
overflow-y: auto;
margin-bottom: 8px;
}

.network-dropdown-divider {
width: 100%;
height: 1px;
Expand Down

0 comments on commit c84604b

Please sign in to comment.