Skip to content

Commit

Permalink
fix: Fix Select z-index issues
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Apr 26, 2023
1 parent 8d8d747 commit a95401b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ export const InsightAuthors = ({ insight, form }) => {
onChange(values);
}}
value={value?.map((author: string) => ({ value: author, label: author }))}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
menuPortal: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '40px' })
}}
Expand Down Expand Up @@ -108,9 +107,8 @@ export const InsightAuthors = ({ insight, form }) => {
onChange(values);
}}
value={value?.map((author: string) => ({ value: author, label: author }))}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
menuPortal: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '40px' })
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ export const InsightMetadataEditor = ({ insight, isNewInsight, form, templates,
}
}}
value={itemTypeOptions && value && itemTypeOptions.find((type) => type.name === value)}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '10px' }),
menuPortal: (base) => ({ ...base, zIndex: 9999 })
valueContainer: (base) => ({ ...base, paddingLeft: '10px' })
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ export const InsightTags = ({ insight, form }) => {
onChange(tags);
}}
value={value.map((tag: string) => ({ value: tag, label: tag }))}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
menuPortal: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '40px' })
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ export const InsightTeam = ({ insight, form }) => {
}
}}
value={{ value, label: value }}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
menuPortal: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '40px' })
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ export const InsightsSettings = ({ user, onSubmit, isSubmitting }: Props) => {
onChange={(e) => (e == null || e == '' ? onChange('') : onChange(e.value))}
value={(templateOptions && value && templateOptions.find((t) => t.value === value)) ?? { value: '' }}
isClearable={true}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '10px' }),
menuPortal: (base) => ({ ...base, zIndex: 9999 })
valueContainer: (base) => ({ ...base, paddingLeft: '10px' })
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ export const ProfileSettings = ({ user, onSubmit, isSubmitting }: Props) => {
}
}}
value={{ value, label: value }}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '40px' })
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ export const SystemSettings = ({ user, onSubmit, isSubmitting }: Props) => {
}}
value={localeOptions && value && localeOptions.find((l) => l.value === value)}
placeholder={`Detected (${detectedLocale})`}
menuPortalTarget={document.body}
styles={{
menu: (base) => ({ ...base, zIndex: 11 }),
container: (base) => ({ ...base, width: '100%' }),
valueContainer: (base) => ({ ...base, paddingLeft: '10px' }),
menuPortal: (base) => ({ ...base, zIndex: 9999 })
valueContainer: (base) => ({ ...base, paddingLeft: '10px' })
}}
/>
)}
Expand Down

0 comments on commit a95401b

Please sign in to comment.