OHIF-298: Fix dropdown color in win browsers (#1981)

* ohif-298: use new select in pagination

* ohif-298: add menu placement

* ohif-298: update border

* ohif-298: fix sticky menu

Co-authored-by: Danny Brown <danny.ri.brown@gmail.com>
This commit is contained in:
Igor OctavianoandDanny Brown authored and GitHub committed 2020-08-19 16:17:05 -04:00
1 parent 8cea1a04d6
commit db39cc2fde
5 files changed
+54 -32

No files matched your search

+12 -3
View File
@@ -43,9 +43,13 @@ const Select = ({
onChange,
options,
placeholder,
noIcons,
menuPlacement,
value,
}) => {
const _components = isMulti ? { Option, MultiValue } : {};
const _noIconComponents = { DropdownIndicator: () => null, IndicatorSeparator: () => null };
let _components = isMulti ? { Option, MultiValue } : {};
_components = noIcons ? { ..._components, ..._noIconComponents } : _components;
const selectedOptions = [];
// Map array of values to an array of selected options
@@ -69,12 +73,13 @@ const Select = ({
isClearable={isClearable}
isMulti={isMulti}
isSearchable={isSearchable}
menuPlacement={menuPlacement}
closeMenuOnSelect={closeMenuOnSelect}
hideSelectedOptions={hideSelectedOptions}
components={_components}
placeholder={placeholder}
options={options}
value={isMulti ? selectedOptions : value}
value={value && Array.isArray(value) ? selectedOptions : value}
onChange={(selectedOptions, { action }) => {
const newSelection = !selectedOptions.length
? selectedOptions
@@ -93,6 +98,8 @@ Select.defaultProps = {
isDisabled: false,
isMulti: false,
isSearchable: true,
noIcons: false,
menuPlacement: 'auto',
value: [],
};
@@ -104,6 +111,8 @@ Select.propTypes = {
isDisabled: PropTypes.bool,
isMulti: PropTypes.bool,
isSearchable: PropTypes.bool,
noIcons: PropTypes.bool,
menuPlacement: PropTypes.oneOf(['auto', 'bottom', 'top']),
onChange: PropTypes.func.isRequired,
options: PropTypes.arrayOf(
PropTypes.shape({
@@ -112,7 +121,7 @@ Select.propTypes = {
})
),
placeholder: PropTypes.string,
value: PropTypes.oneOfType(PropTypes.string, PropTypes.arrayOf(PropTypes.string)),
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.any]),
};
export default Select;