Skip to content

Commit 93fb914

Browse files
committed
fix: improve userField initialization and handle optional chaining for multiple selection
1 parent e87b9a1 commit 93fb914

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/fields/src/widgets/UserField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { FieldWidgetProps } from './types';
88
* Allows selecting one or multiple users
99
*/
1010
export function UserField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>) {
11-
const userField = field as any;
12-
const multiple = userField.multiple || false;
11+
const userField = (field || (props as any).schema) as any;
12+
const multiple = userField?.multiple || false;
1313

1414
if (readonly) {
1515
if (!value) return <span className="text-sm">-</span>;

0 commit comments

Comments
 (0)