Skip to content

Commit

Permalink
Merge pull request #569 from gisce/feature/parse-char-widget-value-wh…
Browse files Browse the repository at this point in the history
…en-get-list-selection-value

fix(char): allow many2one and selection value for widget char
  • Loading branch information
BellaCs authored Aug 6, 2024
2 parents 0cb8199 + d3f140c commit 1e9fd39
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/widgets/base/Char.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ const CharInput = ({
ooui,
requiredStyle,
isSearchField,
onChange,
}: {
value?: any;
ooui: CharOoui;
requiredStyle: CSSProperties | undefined;
isSearchField: boolean;
onChange?: (value: string) => void;
}) => {
const forceDisabled = Array.isArray(value);
const forceDisabled =
Array.isArray(value) || Boolean(ooui.selectionValues.size);
const formContext = useContext(FormContext) as FormContextType;
const { elementHasLostFocus } = formContext || {};
const { id, readOnly, isPassword, translatable } = ooui;
Expand All @@ -76,6 +79,9 @@ const CharInput = ({
style={requiredStyle}
maxLength={ooui.size}
onBlur={elementHasLostFocus}
onChange={(event: any) => {
onChange?.(event.target.value);
}}
/>
);

Expand All @@ -86,6 +92,9 @@ const CharInput = ({
disabled={readOnly}
id={id}
onBlur={elementHasLostFocus}
onChange={(event: any) => {
onChange?.(event.target.value);
}}
/>
);
}
Expand Down

0 comments on commit 1e9fd39

Please sign in to comment.