From 2b4e9fbc718b04bc035c5d8e6caa05c0e8998acd Mon Sep 17 00:00:00 2001 From: Sunny Ripert Date: Mon, 7 Nov 2022 15:41:42 +0100 Subject: [PATCH] [Glitch] Add form element on focal point modal Port 8515bc79628c6e753a09a7da42eff9ce7ed4ade7 to glitch-soc Signed-off-by: Claire --- .../ui/components/focal_point_modal.jsx | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx index d584277dc3..bf31c137f1 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx @@ -181,14 +181,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); }; @@ -318,7 +318,7 @@ class FocalPointModal extends ImmutablePureComponent {
-
+
{focals &&

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