fixed visual bugs

This commit is contained in:
ari committed 2022-09-24 15:12:22 -04:00
1 parent 8fea6f1082
commit d7ca62afa7
11 files changed
+181 -103

No files matched your search

@@ -188,16 +188,14 @@ export function InputAutoComplete<T extends Option>(
const id = getID(option);
return (
<>
<SearchItem
key={label + id}
listProps={listProps}
id={id}
label={label}
searchTerm={inputValue}
onlyShowLabel={props.onlyShowLabel}
/>
</>
<SearchItem
key={label + id}
listProps={listProps}
id={id}
label={label}
searchTerm={inputValue}
onlyShowLabel={props.onlyShowLabel}
/>
);
}}
renderInput={(params) => (
@@ -225,12 +223,13 @@ export function InputAutoComplete<T extends Option>(
)}
renderTags={(tagValue, getTagProps) => {
const inner = (
<div className="input-autocomplete--tags">
<div className="input-autocomplete--tags" key={"inner"}>
{tagValue.map((option, index) => {
const label = getLabel(option);
const id = getID(option);
const tagProps = getTagProps({ index });
tagProps.className += " input-autocomplete--chip";
tagProps.key = tagProps.key ?? index;
return (
<Chip
size="medium"
@@ -258,7 +257,11 @@ export function InputAutoComplete<T extends Option>(
}
if (props.multiple) {
return (
<Badge badgeContent={tagValue.length} color="info">
<Badge
badgeContent={tagValue.length}
color="info"
key="badge-wrapper"
>
{inner}
</Badge>
);
@@ -15,6 +15,7 @@ const { make, componentMeta } = makeStory({
<div
style={{
maxWidth: 200,
margin: "5em",
}}
>
<InputEntity
@@ -127,18 +127,16 @@ export const InputTime: FC<InputTimeProps> = (props) => {
return (
<div className={["input-time", props.className ?? ""].join(" ")}>
{/* <InputLabel >{props.label}</InputLabel> */}
<div className="input-time--inner">
{fields.map((name) => {
{fields.map((name, index) => {
const label = prettyName(
lang.get(`TIME_UNITS_${name}`.toUpperCase())
);
return (
<TextField
key={name}
key={`${name}-${index}`}
variant="filled"
label={label}
defaultValue="00"
InputProps={{
disabled,
type: "number",
@@ -151,6 +149,7 @@ export const InputTime: FC<InputTimeProps> = (props) => {
})}
{!props.restrictEmpty && (
<ButtonIcon
key="disable-btn"
onClick={() => setDisabled(!disabled)}
icon={disabled ? <EditIcon /> : <CloseIcon />}
/>