Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import React, {Component, lazy, Suspense} from 'react';
import dropdown from '../utils/LazyLoader/dropdown';
import './css/Dropdown.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is already imported here:

import '../components/css/Dropdown.css';


const RealDropdown = lazy(dropdown);

Expand All @@ -14,11 +15,36 @@ const RealDropdown = lazy(dropdown);
* constrained for space. Otherwise, you can use RadioItems or a Checklist,
* which have the benefit of showing the users all of the items at once.
*/
export default class Dropdown extends Component {
export default class Dropdown extends Component {
render() {
const { style, className, ...props } = this.props;
return (
<Suspense fallback={null}>
<RealDropdown {...this.props} />
<RealDropdown
{...props}
className={`dash-dropdown ${className || ''}`}
styles={{
control: (provided) => ({
...provided,
Copy link
Contributor

Choose a reason for hiding this comment

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

Provided should be at the end to possibly overload the defaults.

display: 'inline-block',
verticalAlign: 'middle',
width: style?.width || '300px', // Default width
}),
menu: (provided) => ({
...provided,
maxHeight: 'none',
display: 'inline-block',
width: style?.width || '300px', // Default width
verticalAlign: 'middle',
}),
menuOuter: (provided) => ({
...provided,
maxHeight: 'none',
zIndex: 1000,
width: style?.width || '300px', // Default width
}),
}}
/>
</Suspense>
);
}
Expand Down
18 changes: 15 additions & 3 deletions components/dash-core-components/src/components/css/Dropdown.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
.dash-dropdown .Select-menu-outer {
z-index: 1000;
max-height: none;
.dash-dropdown .Select-control {
display: inline-block;
width: 300px;
vertical-align: middle;
margin-left: 785px;
}

.dash-dropdown .Select-menu {
max-height: none;
display: inline-block;
width: 300px;
vertical-align: middle;
}

.dash-dropdown .Select-menu-outer {
z-index: 1000;
max-height: none;
width: 300px;
margin-left: 785px;
}