Skip to content

Commit 4ffccae

Browse files
authored
fix FilterKeyType.tsx dropdown display (#4820)
1 parent 86440a9 commit 4ffccae

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

redisinsight/ui/src/pages/browser/components/filter-key-type/FilterKeyType.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,27 @@ import { appFeatureFlagsFeaturesSelector } from 'uiSrc/slices/app/features'
2323
import { AdditionalRedisModule } from 'uiSrc/slices/interfaces'
2424
import { OutsideClickDetector } from 'uiSrc/components/base/utils'
2525
import { HealthText } from 'uiSrc/components/base/text/HealthText'
26-
import { RiSelect } from 'uiSrc/components/base/forms/select/RiSelect'
26+
import {
27+
defaultValueRender,
28+
RiSelect,
29+
} from 'uiSrc/components/base/forms/select/RiSelect'
2730
import { Modal } from 'uiSrc/components/base/display'
2831
import { FILTER_KEY_TYPE_OPTIONS } from './constants'
2932

3033
import styles from './styles.module.scss'
34+
import styled from 'styled-components'
3135

3236
const ALL_KEY_TYPES_VALUE = 'all'
3337

3438
export interface Props {
3539
modules?: AdditionalRedisModule[]
3640
}
3741

42+
const FilterKeyTypeSelect = styled(RiSelect)`
43+
height: 100%;
44+
border-radius: 0;
45+
`
46+
3847
const FilterKeyType = ({ modules }: Props) => {
3948
const [isSelectOpen, setIsSelectOpen] = useState<boolean>(false)
4049
const [typeSelected, setTypeSelected] = useState<string>('all')
@@ -157,7 +166,9 @@ const FilterKeyType = ({ modules }: Props) => {
157166
onCancel={() => setIsInfoPopoverOpen(false)}
158167
className={styles.unsupportedInfoModal}
159168
data-testid="filter-not-available-modal"
160-
content={<FilterNotAvailable onClose={() => setIsInfoPopoverOpen(false)} />}
169+
content={
170+
<FilterNotAvailable onClose={() => setIsInfoPopoverOpen(false)} />
171+
}
161172
title={null}
162173
/>
163174
{!isVersionSupported && (
@@ -168,15 +179,10 @@ const FilterKeyType = ({ modules }: Props) => {
168179
data-testid="unsupported-btn-anchor"
169180
/>
170181
)}
171-
<RiSelect
182+
<FilterKeyTypeSelect
172183
disabled={!isVersionSupported}
173184
options={options}
174-
valueRender={({ option, isOptionValue }) => {
175-
if (isOptionValue) {
176-
return option.inputDisplay
177-
}
178-
return option.dropdownDisplay
179-
}}
185+
valueRender={defaultValueRender}
180186
defaultOpen={isSelectOpen}
181187
value={typeSelected}
182188
onChange={(value: string) => onChangeType(value)}

0 commit comments

Comments
 (0)