@usefillo/dom 0.5.1 → 0.5.3
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/dist/standalone.global.js +5 -5
- package/dist/styles.css +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -887,9 +887,10 @@ function isAutoSubmitBlock(block) {
|
|
|
887
887
|
return isField(block) && (block.kind === "select" || block.kind === "dropdown" || block.kind === "checkbox" || block.kind === "rating" || block.kind === "linear_scale");
|
|
888
888
|
}
|
|
889
889
|
function needsExplicitSubmit(visible) {
|
|
890
|
-
|
|
891
|
-
if (
|
|
892
|
-
|
|
890
|
+
const interactive = visible.filter((b) => !(isField(b) && b.kind === "hidden"));
|
|
891
|
+
if (interactive.length === 0) return false;
|
|
892
|
+
if (interactive.length > 1) return true;
|
|
893
|
+
return !isAutoSubmitBlock(interactive[0]);
|
|
893
894
|
}
|
|
894
895
|
function defaultFieldRenderer(context) {
|
|
895
896
|
if (context.field.kind === "hidden") return null;
|
|
@@ -916,8 +917,8 @@ function shouldAutoSubmit(field, value, api, uploading) {
|
|
|
916
917
|
})();
|
|
917
918
|
if (!hasDiscreteAnswer) return false;
|
|
918
919
|
const nextData = { ...api.data, [field.id]: value };
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
920
|
+
const interactive = visibleFields(api.form, nextData).filter((f) => f.kind !== "hidden");
|
|
921
|
+
if (interactive.length !== 1 || interactive[0]?.id !== field.id) return false;
|
|
921
922
|
return validateResponse(api.form, nextData).ok;
|
|
922
923
|
}
|
|
923
924
|
var DomFormController = class {
|