DSingh0304 opened a new pull request, #3286: URL: https://github.com/apache/apisix-dashboard/pull/3286
**Why submit this pull request?** - [x] Bugfix - [ ] New feature provided - [ ] Improve performance - [ ] Backport patches **What changes will this PR take into?** This PR fixes a runtime error `"a.trim is not a function"` that occurs when viewing a route with a `vars` field in the detail page. The issue was caused by the [TagsInput](cci:1://file:///home/deep/Desktop/Code/Organizations/apisix-dashboard/src/components/form/TagInput.tsx:34:0-68:2) component (from Mantine) receiving non-string values (arrays) in some edge cases. The Mantine [TagsInput](cci:1://file:///home/deep/Desktop/Code/Organizations/apisix-dashboard/src/components/form/TagInput.tsx:34:0-68:2) internally calls `.trim()` on each value, which fails when the value is not a string. **Changes made:** - Added a defensive check in [src/components/form/TagInput.tsx](cci:7://file:///home/deep/Desktop/Code/Organizations/apisix-dashboard/src/components/form/TagInput.tsx:0:0-0:0) to ensure the value passed to [TagsInput](cci:1://file:///home/deep/Desktop/Code/Organizations/apisix-dashboard/src/components/form/TagInput.tsx:34:0-68:2) is always an array of strings - Non-string values are now filtered out before being passed to the component **Related issues** fix #3280 **Checklist:** - [x] Did you explain what problem does this PR solve? Or what new features have been added? - [x] Have you added corresponding test cases? - [ ] Have you modified the corresponding document? - [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first -- 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]
