1515 */
1616import React , { useEffect , useMemo , useState } from 'react' ;
1717
18+ import { makeStyles } from 'tss-react/mui' ;
1819import Box from '@mui/material/Box' ;
1920import Autocomplete , { AutocompleteValue } from '@mui/material/Autocomplete' ;
2021import FormControl from '@mui/material/FormControl' ;
@@ -36,11 +37,21 @@ import {
3637import { UiProps } from '../uiPropTypes' ;
3738import { ErrorText } from './ErrorText' ;
3839
40+ const useStyles = makeStyles ( ) ( _ => ( {
41+ chipBox : {
42+ '& > div' : {
43+ // not referencing the chip's <div> directly to avoid interference with getTagProps()
44+ 'margin-bottom' : 0 ,
45+ } ,
46+ } ,
47+ } ) ) ;
48+
3949export const ActiveMultiSelect : Widget <
4050 JsonObject ,
4151 JSONSchema7 ,
4252 OrchestratorFormContextProps
4353> = props => {
54+ const { classes } = useStyles ( ) ;
4455 const templateUnitEvaluator = useTemplateUnitEvaluator ( ) ;
4556 const { id, name, label, value : rawValue , onChange, formContext } = props ;
4657 const value = rawValue as string [ ] ;
@@ -137,7 +148,7 @@ export const ActiveMultiSelect: Widget<
137148 ) }
138149 renderTags = { ( values , getTagProps ) =>
139150 values . map ( ( item , index ) => (
140- < Box key = { item } title = { item } >
151+ < Box key = { item } title = { item } className = { classes . chipBox } >
141152 < Chip
142153 data-testid = { `${ id } -chip-${ item } ` }
143154 variant = "outlined"
0 commit comments