File tree 1 file changed +11
-5
lines changed
packages/web/src/views/Forms/EventForm
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -136,9 +136,15 @@ export const EventForm: React.FC<FormProps> = ({
136
136
onClose ( ) ;
137
137
} ;
138
138
139
- const ignoreDelete = ( e : KeyboardEvent ) => {
139
+ const handleIgnoredKeys = ( e : KeyboardEvent ) => {
140
+ const ignore = ( e : KeyboardEvent ) => e . stopPropagation ( ) ;
141
+
140
142
if ( e . key === Key . Backspace ) {
141
- e . stopPropagation ( ) ;
143
+ ignore ( e ) ;
144
+ }
145
+
146
+ if ( ( e . metaKey || e . ctrlKey ) && e . key . toLowerCase ( ) === "k" ) {
147
+ ignore ( e ) ;
142
148
}
143
149
} ;
144
150
@@ -204,7 +210,7 @@ export const EventForm: React.FC<FormProps> = ({
204
210
} ;
205
211
206
212
useHotkeys (
207
- "meta+[ " ,
213
+ "meta+k " ,
208
214
( ) => {
209
215
onConvert ?.( ) ;
210
216
} ,
@@ -272,7 +278,7 @@ export const EventForm: React.FC<FormProps> = ({
272
278
< StyledTitle
273
279
autoFocus
274
280
onChange = { onChangeEventTextField ( "title" ) }
275
- onKeyDown = { ignoreDelete }
281
+ onKeyDown = { handleIgnoredKeys }
276
282
placeholder = "Title"
277
283
role = "textarea"
278
284
name = "Event Title"
@@ -294,7 +300,7 @@ export const EventForm: React.FC<FormProps> = ({
294
300
< StyledDescription
295
301
underlineColor = { priorityColor }
296
302
onChange = { onChangeEventTextField ( "description" ) }
297
- onKeyDown = { ignoreDelete }
303
+ onKeyDown = { handleIgnoredKeys }
298
304
placeholder = "Description"
299
305
ref = { descriptionRef }
300
306
value = { event . description || "" }
You can’t perform that action at this time.
0 commit comments