From 8515bc79628c6e753a09a7da42eff9ce7ed4ade7 Mon Sep 17 00:00:00 2001 From: Sunny Ripert Date: Mon, 7 Nov 2022 15:41:42 +0100 Subject: [PATCH] Add form element on focal point modal (#19834) * Add form element on focal point modal * Add type="button" for detection button --- .../ui/components/focal_point_modal.js | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/app/javascript/mastodon/features/ui/components/focal_point_modal.js b/app/javascript/mastodon/features/ui/components/focal_point_modal.js index a2e6b3d16b..ba8aa8f039 100644 --- a/app/javascript/mastodon/features/ui/components/focal_point_modal.js +++ b/app/javascript/mastodon/features/ui/components/focal_point_modal.js @@ -176,14 +176,14 @@ class FocalPointModal extends ImmutablePureComponent { handleKeyDown = (e) => { if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { - e.preventDefault(); - e.stopPropagation(); this.props.onChangeDescription(e.target.value); - this.handleSubmit(); + this.handleSubmit(e); } } - handleSubmit = () => { + handleSubmit = (e) => { + e.preventDefault(); + e.stopPropagation(); this.props.onSave(this.props.description, this.props.focusX, this.props.focusY); } @@ -313,7 +313,7 @@ class FocalPointModal extends ImmutablePureComponent {
-
+
{focals &&

} {thumbnailable && ( @@ -361,12 +361,23 @@ class FocalPointModal extends ImmutablePureComponent {
- +
-
+