Skip to content

Commit 1e8ec87

Browse files
authored
Biz/dj 2789 show prop label instead of the value (#15370)
* Show label instead of value on async option selection * Update changelog * Update changelog * Update changelog
1 parent 5f19b18 commit 1e8ec87

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

packages/connect-react/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<!-- markdownlint-disable MD024 -->
22
# Changelog
33

4+
# [1.0.0-preview.23] - 2025-01-22
5+
6+
- Show the prop label instead of the value after selecting from a dropdown for string array props
7+
48
# [1.0.0-preview.22] - 2025-01-21
59

610
- Allow custom string input for remote options

packages/connect-react/examples/nextjs/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/connect-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.0.0-preview.22",
3+
"version": "1.0.0-preview.23",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/components/ControlSelect.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,17 @@ export function ControlSelect<T>({
4747
if (typeof ret[0] !== "object") {
4848
const lvs = [];
4949
for (const o of ret) {
50-
lvs.push({
50+
let obj = {
5151
label: o,
5252
value: o,
53-
});
53+
}
54+
for (const item of options) {
55+
if (item.value === o) {
56+
obj = item;
57+
break;
58+
}
59+
}
60+
lvs.push(obj);
5461
}
5562
ret = lvs;
5663
}

pnpm-lock.yaml

Lines changed: 7 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)