Skip to content

Commit 022cd51

Browse files
committed
[Fix]: #1060 exposed .value to open correct URL
1 parent 46599c4 commit 022cd51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client/packages/lowcoder/src/comps/comps/buttonComp/scannerComp.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import React, {
3030
useState,
3131
useContext,
3232
} from "react";
33-
import { arrayStringExposingStateControl } from "comps/controls/codeStateControl";
33+
import { arrayStringExposingStateControl, stringExposingStateControl } from "comps/controls/codeStateControl";
3434
import { BoolControl } from "comps/controls/boolControl";
3535
import { RefControl } from "comps/controls/refControl";
3636
import { EditorContext } from "comps/editorState";
@@ -120,6 +120,7 @@ const BarcodeScannerComponent = React.lazy(
120120
const ScannerTmpComp = (function () {
121121
const childrenMap = {
122122
data: arrayStringExposingStateControl("data"),
123+
value: stringExposingStateControl("value"),
123124
text: withDefault(StringControl, trans("scanner.text")),
124125
continuous: BoolControl,
125126
uniqueData: withDefault(BoolControl, true),
@@ -166,9 +167,11 @@ const ScannerTmpComp = (function () {
166167
const val = props.uniqueData
167168
? [...new Set(continuousValue.current)]
168169
: continuousValue.current;
170+
props.value.onChange(scannedText);
169171
props.data.onChange(val);
170172
props.onEvent("success");
171173
} else {
174+
props.value.onChange(result.text);
172175
props.data.onChange([result.text]);
173176
setShowModal(false);
174177
setSuccess(true);
@@ -326,6 +329,7 @@ const ScannerTmpComp = (function () {
326329

327330
export const ScannerComp = withExposingConfigs(ScannerTmpComp, [
328331
new NameConfig("data", trans("data")),
332+
new NameConfig("value", trans("value")),
329333
new NameConfig("text", trans("button.textDesc")),
330334
...CommonNameConfig,
331335
]);

0 commit comments

Comments
 (0)