@magento/peregrine 13.0.0 → 13.0.1-alpha.1

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.
@@ -85,6 +85,14 @@ export const useCreateAccount = props => {
85
85
  onCancel();
86
86
  }, [onCancel]);
87
87
 
88
+ const handleCancelKeyPress = useCallback(() => {
89
+ event => {
90
+ if (event.key === 'Enter') {
91
+ handleCancel();
92
+ }
93
+ };
94
+ }, [handleCancel]);
95
+
88
96
  const handleSubmit = useCallback(
89
97
  async formValues => {
90
98
  setIsSubmitting(true);
@@ -167,6 +175,7 @@ export const useCreateAccount = props => {
167
175
  setIsSubmitting(false);
168
176
  }
169
177
  },
178
+
170
179
  [
171
180
  cartId,
172
181
  generateReCaptchaData,
@@ -209,6 +218,7 @@ export const useCreateAccount = props => {
209
218
  errors,
210
219
  handleCancel,
211
220
  handleSubmit,
221
+ handleCancelKeyPress,
212
222
  initialValues: sanitizedInitialValues,
213
223
  isDisabled: isSubmitting || isGettingDetails || recaptchaLoading,
214
224
  recaptchaWidgetProps
@@ -81,6 +81,7 @@ export const useSignIn = props => {
81
81
  },
82
82
  ...recaptchaData
83
83
  });
84
+
84
85
  const token = signInResponse.data.generateCustomerToken.token;
85
86
  await setToken(token);
86
87
 
@@ -173,6 +174,14 @@ export const useSignIn = props => {
173
174
  };
174
175
  }, [handleCreateAccount]);
175
176
 
177
+ const signinHandleEnterKeyPress = useCallback(() => {
178
+ event => {
179
+ if (event.key === 'Enter') {
180
+ handleSubmit();
181
+ }
182
+ };
183
+ }, [handleSubmit]);
184
+
176
185
  const errors = useMemo(
177
186
  () =>
178
187
  new Map([
@@ -186,6 +195,7 @@ export const useSignIn = props => {
186
195
  errors,
187
196
  handleCreateAccount,
188
197
  handleEnterKeyPress,
198
+ signinHandleEnterKeyPress,
189
199
  handleForgotPassword,
190
200
  handleSubmit,
191
201
  isBusy: isGettingDetails || isSigningIn || recaptchaLoading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magento/peregrine",
3
- "version": "13.0.0",
3
+ "version": "13.0.1-alpha.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },