@wix/form-public 0.173.0 → 0.175.0
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.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -25339,7 +25339,8 @@ var NOW_VALUE = "$now";
|
|
|
25339
25339
|
|
|
25340
25340
|
// ../form-fields/dist/esm/constants/experiments.js
|
|
25341
25341
|
var EXPERIMENTS = {
|
|
25342
|
-
USE_FIELDS_V2: "specs.forms.UseFieldsV2"
|
|
25342
|
+
USE_FIELDS_V2: "specs.forms.UseFieldsV2",
|
|
25343
|
+
SUBMIT_SUCCESS_NO_FOCUS: "specs.forms.SubmitSuccessNoFocus"};
|
|
25343
25344
|
|
|
25344
25345
|
// ../form-fields/dist/esm/constants/breakpoints.js
|
|
25345
25346
|
var Breakpoint = /* @__PURE__ */ (function(Breakpoint2) {
|
|
@@ -32116,6 +32117,8 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
|
|
|
32116
32117
|
const { report } = useBi();
|
|
32117
32118
|
const fireSubmitSuccess = useSubmitSuccessTrigger();
|
|
32118
32119
|
const panorama = usePanorama();
|
|
32120
|
+
const { isExperimentEnabled } = useExperiments();
|
|
32121
|
+
const focusOnSubmitSuccess = !isExperimentEnabled(EXPERIMENTS.SUBMIT_SUCCESS_NO_FOCUS);
|
|
32119
32122
|
const reportSubmitFormBi = useCallback(({ status, id }) => report(submitFormClick({
|
|
32120
32123
|
submission_status: status,
|
|
32121
32124
|
submission_id: id ?? void 0
|
|
@@ -32131,9 +32134,11 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
|
|
|
32131
32134
|
if (submitSettings?.thankYouMessageOptions?.durationInSeconds) {
|
|
32132
32135
|
setTimeout(() => {
|
|
32133
32136
|
setSubmitSuccessMessage(void 0);
|
|
32134
|
-
|
|
32137
|
+
if (focusOnSubmitSuccess) {
|
|
32138
|
+
handleStepChange(0);
|
|
32139
|
+
}
|
|
32135
32140
|
}, submitSettings?.thankYouMessageOptions?.durationInSeconds * 1e3);
|
|
32136
|
-
} else {
|
|
32141
|
+
} else if (focusOnSubmitSuccess) {
|
|
32137
32142
|
handleStepChange(0);
|
|
32138
32143
|
}
|
|
32139
32144
|
} else if (action === SubmitSuccessAction.REDIRECT) {
|
|
@@ -32145,6 +32150,7 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
|
|
|
32145
32150
|
t,
|
|
32146
32151
|
submitSettings,
|
|
32147
32152
|
handleStepChange,
|
|
32153
|
+
focusOnSubmitSuccess,
|
|
32148
32154
|
navigateToCheckout,
|
|
32149
32155
|
setSubmitSuccessMessage,
|
|
32150
32156
|
setSubmitFailureCode,
|