Limit the number of choices in member input
This commit is contained in:
parent
21b64d9f43
commit
cf7ad598db
@ -65,11 +65,13 @@ export function MemberInput(p: {
|
||||
}}
|
||||
options={choices}
|
||||
sx={{ width: "100%" }}
|
||||
filterOptions={(options, state) =>
|
||||
options.filter((m) =>
|
||||
filterOptions={(options, state) => {
|
||||
const res = options.filter((m) =>
|
||||
m?.fullName.toLowerCase().includes(state.inputValue)
|
||||
)
|
||||
}
|
||||
);
|
||||
res.length = Math.min(15, res.length);
|
||||
return res;
|
||||
}}
|
||||
getOptionLabel={(o) => o?.fullName ?? ""}
|
||||
renderInput={(params) => <TextField {...params} label={p.label} />}
|
||||
renderOption={(_props, option, _state) => (
|
||||
|
Loading…
Reference in New Issue
Block a user