@wix/form-public 0.173.0 → 0.174.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 +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -25365,7 +25365,9 @@ var NOW_VALUE = "$now";
|
|
|
25365
25365
|
|
|
25366
25366
|
// ../form-fields/dist/esm/constants/experiments.js
|
|
25367
25367
|
var EXPERIMENTS = {
|
|
25368
|
-
USE_FIELDS_V2: "specs.forms.UseFieldsV2"
|
|
25368
|
+
USE_FIELDS_V2: "specs.forms.UseFieldsV2",
|
|
25369
|
+
SUBMIT_SUCCESS_NO_FOCUS: "specs.forms.SubmitSuccessNoFocus"
|
|
25370
|
+
};
|
|
25369
25371
|
|
|
25370
25372
|
// ../form-fields/dist/esm/constants/breakpoints.js
|
|
25371
25373
|
var Breakpoint = /* @__PURE__ */ (function(Breakpoint2) {
|
|
@@ -32142,6 +32144,8 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
|
|
|
32142
32144
|
const { report } = useBi();
|
|
32143
32145
|
const fireSubmitSuccess = useSubmitSuccessTrigger();
|
|
32144
32146
|
const panorama = usePanorama();
|
|
32147
|
+
const { isExperimentEnabled } = useExperiments();
|
|
32148
|
+
const focusOnSubmitSuccess = !isExperimentEnabled(EXPERIMENTS.SUBMIT_SUCCESS_NO_FOCUS);
|
|
32145
32149
|
const reportSubmitFormBi = React42.useCallback(({ status, id }) => report(submitFormClick({
|
|
32146
32150
|
submission_status: status,
|
|
32147
32151
|
submission_id: id ?? void 0
|
|
@@ -32157,9 +32161,11 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
|
|
|
32157
32161
|
if (submitSettings?.thankYouMessageOptions?.durationInSeconds) {
|
|
32158
32162
|
setTimeout(() => {
|
|
32159
32163
|
setSubmitSuccessMessage(void 0);
|
|
32160
|
-
|
|
32164
|
+
if (focusOnSubmitSuccess) {
|
|
32165
|
+
handleStepChange(0);
|
|
32166
|
+
}
|
|
32161
32167
|
}, submitSettings?.thankYouMessageOptions?.durationInSeconds * 1e3);
|
|
32162
|
-
} else {
|
|
32168
|
+
} else if (focusOnSubmitSuccess) {
|
|
32163
32169
|
handleStepChange(0);
|
|
32164
32170
|
}
|
|
32165
32171
|
} else if (action === SubmitSuccessAction.REDIRECT) {
|
|
@@ -32171,6 +32177,7 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
|
|
|
32171
32177
|
t,
|
|
32172
32178
|
submitSettings,
|
|
32173
32179
|
handleStepChange,
|
|
32180
|
+
focusOnSubmitSuccess,
|
|
32174
32181
|
navigateToCheckout,
|
|
32175
32182
|
setSubmitSuccessMessage,
|
|
32176
32183
|
setSubmitFailureCode,
|