File tree Expand file tree Collapse file tree
app/javascript/mastodon/features/ui/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,6 +184,15 @@ class FocalPointModal extends ImmutablePureComponent {
184184 this . setState ( { description : e . target . value , dirty : true } ) ;
185185 }
186186
187+ handleKeyDown = ( e ) => {
188+ if ( e . keyCode === 13 && ( e . ctrlKey || e . metaKey ) ) {
189+ e . preventDefault ( ) ;
190+ e . stopPropagation ( ) ;
191+ this . setState ( { description : e . target . value , dirty : true } ) ;
192+ this . handleSubmit ( ) ;
193+ }
194+ }
195+
187196 handleSubmit = ( ) => {
188197 this . props . onSave ( this . state . description , this . state . focusX , this . state . focusY ) ;
189198 this . props . onClose ( ) ;
@@ -254,6 +263,7 @@ class FocalPointModal extends ImmutablePureComponent {
254263 className = 'setting-text light'
255264 value = { detecting ? '…' : description }
256265 onChange = { this . handleChange }
266+ onKeyDown = { this . handleKeyDown }
257267 disabled = { detecting }
258268 autoFocus
259269 />
You can’t perform that action at this time.
0 commit comments