@usefillo/react 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1359,8 +1359,8 @@ function shouldAutoSubmit(field, value, api) {
|
|
|
1359
1359
|
if (!hasDiscreteAnswer) return false;
|
|
1360
1360
|
if (value === api.data[field.id]) return false;
|
|
1361
1361
|
const nextData = { ...api.data, [field.id]: value };
|
|
1362
|
-
const
|
|
1363
|
-
if (
|
|
1362
|
+
const interactive = visibleFields(api.form, nextData).filter((f) => f.kind !== "hidden");
|
|
1363
|
+
if (interactive.length !== 1 || interactive[0]?.id !== field.id) return false;
|
|
1364
1364
|
return validateResponse(api.form, nextData).ok;
|
|
1365
1365
|
}
|
|
1366
1366
|
function blockHasPiping(block) {
|
|
@@ -1491,9 +1491,10 @@ function isAutoSubmitBlock(block) {
|
|
|
1491
1491
|
return isField2(block) && (block.kind === "select" || block.kind === "dropdown" || block.kind === "checkbox" || block.kind === "rating" || block.kind === "linear_scale");
|
|
1492
1492
|
}
|
|
1493
1493
|
function needsExplicitSubmit(visible) {
|
|
1494
|
-
|
|
1495
|
-
if (
|
|
1496
|
-
|
|
1494
|
+
const interactive = visible.filter((b) => !(isField2(b) && b.kind === "hidden"));
|
|
1495
|
+
if (interactive.length === 0) return false;
|
|
1496
|
+
if (interactive.length > 1) return true;
|
|
1497
|
+
return !isAutoSubmitBlock(interactive[0]);
|
|
1497
1498
|
}
|
|
1498
1499
|
function FilloForm(props) {
|
|
1499
1500
|
const { form, formId } = props;
|