Skip to content

Commit

Permalink
rollback last changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilan committed Jun 7, 2024
1 parent 1b8ba66 commit 8192597
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
2 changes: 0 additions & 2 deletions packages/react-ui/src/components/molecules/Autocomplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export type AutocompleteProps<
> = MuiAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent> & {
creatable?: boolean;
newItemTitle?: React.ReactNode | string;
startAdornment?: React.ReactNode;
inputParams?: object;
};

declare const Autocomplete: <
Expand Down
22 changes: 1 addition & 21 deletions packages/react-ui/src/components/molecules/Autocomplete.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React, { forwardRef } from 'react';
import PropTypes from 'prop-types';
import {
InputAdornment,
MenuItem,
Autocomplete as MuiAutocomplete,
TextField,
createFilterOptions
} from '@mui/material';

Expand Down Expand Up @@ -69,32 +67,14 @@ const Autocomplete = forwardRef(
renderOption={creatable ? creatableRenderOption : renderOption}
freeSolo={creatable || freeSolo}
forcePopupIcon={creatable || forcePopupIcon}
renderInput={(params) => {
if (startAdornment) {
params.InputProps.startAdornment = (
<InputAdornment position='start'>{startAdornment}</InputAdornment>
);
}
return (
<div ref={params.InputProps.ref}>
<TextField
{...params}
{...inputParams}
InputLabelProps={{ shrink: true }}
/>
</div>
);
}}
/>
);
}
);

Autocomplete.propTypes = {
creatable: PropTypes.bool,
newItemTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
startAdornment: PropTypes.element,
inputParams: PropTypes.object
newItemTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
};

export default Autocomplete;

0 comments on commit 8192597

Please sign in to comment.