-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Biz/dj 2813 support custom input strings in connect react #15356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,7 @@ export function RemoteOptionsContainer({ queryEnabled }: RemoteOptionsContainerP | |
|
||
return ( | ||
<ControlSelect | ||
isCreatable={true} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification 🛠️ Refactor suggestion Confirmed: isCreatable needs to be configurable The component's props interface (
🔗 Analysis chainMake isCreatable configurable instead of hardcoded. Hardcoding Consider making it configurable: - isCreatable={true}
+ isCreatable={prop.allowCustomInput} This would require adding an Let's check if the prop configuration schema already supports this: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for prop configuration schema
rg -A 5 "type.*PropConfiguration" || rg -A 5 "interface.*PropConfiguration"
Length of output: 76 Script: #!/bin/bash
# Check RemoteOptionsContainer.tsx for prop definitions
cat packages/connect-react/src/components/RemoteOptionsContainer.tsx | grep -A 10 "interface.*Props"
# Search for any remote options related types/interfaces
rg -g "*.ts*" -A 5 "interface.*Remote.*Props|type.*Remote.*Props"
Length of output: 760 |
||
showLoadMoreButton={showLoadMoreButton()} | ||
onLoadMore={onLoadMore} | ||
options={pageable.data} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid direct array mutation and add input validation.
The
handleCreate
function directly mutates theoptions
array, which could lead to unexpected behavior in React. Additionally, there's no validation of the input value.Consider this safer implementation: