Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-32188] Fix Apps modal styling issues #7748

Merged
merged 2 commits into from
Apr 9, 2021
Merged
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
29 changes: 20 additions & 9 deletions components/apps_form/apps_form_field/apps_form_select_field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ export type State = {
field: AppField;
}

const reactStyles = {
menuPortal: (provided: React.CSSProperties) => ({
...provided,
zIndex: 9999,
}),
};

const commonProps = {
isClearable: true,
openMenuOnFocus: false,
classNamePrefix: 'react-select-auto react-select',
menuPortalTarget: document.body,
styles: reactStyles,
};

export default class AppsFormSelectField extends React.PureComponent<Props, State> {
constructor(props: Props) {
super(props);
Expand Down Expand Up @@ -57,18 +72,16 @@ export default class AppsFormSelectField extends React.PureComponent<Props, Stat
const value = this.props.value;

return (
<div className='form-group'>
<div className={'react-select'}>
<AsyncSelect
id={`MultiInput_${field.name}`}
loadOptions={this.loadDynamicOptions}
defaultOptions={true}
isMulti={field.multiselect || false}
isClearable={true}
openMenuOnFocus={false}
placeholder={placeholder}
value={value}
onChange={this.onChange as any} // types are not working correctly for multiselect
classNamePrefix='react-select-auto react-select'
{...commonProps}
/>
</div>
);
Expand All @@ -83,17 +96,15 @@ export default class AppsFormSelectField extends React.PureComponent<Props, Stat
const value = this.props.value;

return (
<div className='form-group'>
<div className={'react-select'}>
<ReactSelect
id={`MultiInput_${field.name}`}
options={options}
isMulti={field.multiselect || false}
isClearable={true}
openMenuOnFocus={false}
placeholder={placeholder}
value={value}
onChange={this.onChange as any} // types are not working correctly for multiselect
classNamePrefix='react-select-auto react-select'
{...commonProps}
/>
</div>
);
Expand All @@ -112,7 +123,7 @@ export default class AppsFormSelectField extends React.PureComponent<Props, Stat
}

return (
<div>
<div className='form-group'>
<label>
{label}
</label>
Expand Down