Skip to content

Commit

Permalink
Merge pull request #147 from osstotalsoft/fixAutocomplete
Browse files Browse the repository at this point in the history
cahnges on Autocomplete
  • Loading branch information
andra-sava authored Dec 6, 2024
2 parents 302bda2 + ee361ee commit 088789c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/components/inputs/Autocomplete/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import {
import { both, concat, eqBy, has, identity, map, prop } from 'ramda'
import { convertValueToOption, extractFirstValue, internalLabel, internalValue } from './utils'
import Option from './Option'
import { emptyArray, emptyString } from 'components/utils/constants'
import { useTrackVisibility } from 'react-intersection-observer-hook'
import { AutocompleteProps, LoadOptionsPaginatedResult } from './types'
import LinearProgress from 'components/feedback/LinearProgress'
import LinearProgress from '../../feedback/LinearProgress'
import { emptyArray, emptyString } from '../../utils/constants'
const baseFilter = createFilterOptions()

const Autocomplete: React.FC<
Expand Down Expand Up @@ -211,7 +211,7 @@ const Autocomplete: React.FC<
>
) => {
/**
* Display the loading text and attach a reference to monitor the visibility this option.
* Display the loading text and attach a reference to monitor the visibility of this option.
* This should be the last option in the list. And it should only be added from the internal mechanism.
* The visibility will be used to trigger the loadOptions function.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/inputs/Autocomplete/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { emptyString } from 'components/utils/constants'
import { emptyString } from '../../utils/constants'
import { any, curry, either, equals, find, head, isEmpty, isNil, prop, type } from 'ramda'

export const isNilOrEmpty = either(isNil, isEmpty)
Expand Down
21 changes: 11 additions & 10 deletions src/components/themes/common/overrides/Autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ export default function Autocomplete(theme: Theme): CustomComponents {
return {
MuiAutocomplete: {
styleOverrides: {
inputRoot: {
'& .MuiAutocomplete-input': {
width: 'fit-content',
minWidth: 'fit-content'
}
},
inputRoot: (props: any) =>
!props.ownerState.multiple && {
'& .MuiAutocomplete-input': {
width: 'fit-content',
minWidth: 'fit-content'
}
},
input: {
display: 'flex',
whiteSpace: 'nowrap'
},
noOptions: {
...theme.typography.defaultFont,
padding: `${theme.spacing()}px ${theme.spacing(2)}px`,
color: 'textSecondary'
},
...theme.typography.defaultFont,
padding: `${theme.spacing()}px ${theme.spacing(2)}px`,
color: 'textSecondary'
},
option: {
div: {
...theme.typography.defaultFont,
Expand Down

0 comments on commit 088789c

Please sign in to comment.