DSingh0304 commented on code in PR #3286:
URL: https://github.com/apache/apisix-dashboard/pull/3286#discussion_r2874059369


##########
src/components/form/TagInput.tsx:
##########
@@ -44,9 +44,16 @@ export const FormItemTagsInput = <T extends FieldValues, R>(
     field: { value, onChange: fOnChange, ...restField },
     fieldState,
   } = useController<T>(controllerProps);
+
+  // Defensive: ensure value is always an array of strings to prevent
+  // "a.trim is not a function" errors when non-string values are passed
+  const safeValue = Array.isArray(value)
+    ? value.filter((item: unknown): item is string => typeof item === 'string')
+    : [];
+
   return (
     <TagsInput
-      value={from ? value.map(from) : value}
+      value={from ? safeValue.map(from) : safeValue}

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to