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