Tempo: Tab button doesn't work when in the Tags field (#56458)

Co-authored-by: gitstart <gitstart@gitstart.com>
Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com>
Co-authored-by: RubensRafael <rubensrafael2@live.com>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
Co-authored-by: Matheus Muniz <matheusmuniz100@hotmail.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com>
Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com>
This commit is contained in:
GitStart 2022-10-11 14:33:59 +05:30 committed by GitHub
parent 66cb56de79
commit bc632f239d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -192,7 +192,7 @@ export class UnThemedQueryField extends PureComponent<QueryFieldProps, QueryFiel
onBlur();
} else {
// Run query by default on blur
const previousValue = this.lastExecutedValue ? Plain.serialize(this.lastExecutedValue) : null;
const previousValue = this.lastExecutedValue ? Plain.serialize(this.lastExecutedValue) : '';
const currentValue = Plain.serialize(editor.value);
if (previousValue !== currentValue) {

View File

@ -1,6 +1,7 @@
import { isKeyHotkey } from 'is-hotkey';
import React from 'react';
import { RangeJSON, Range as SlateRange } from 'slate';
import Plain from 'slate-plain-serializer';
import { Editor, Plugin } from 'slate-react';
const isIndentLeftHotkey = isKeyHotkey('mod+[');
@ -18,7 +19,10 @@ const handleTabKey = (event: React.KeyboardEvent<Element>, editor: Editor, next:
end: { offset: endOffset, key: endKey },
},
} = editor.value;
if (Plain.serialize(editor.value) === '') {
return;
}
event.preventDefault();
const first = startBlock.getFirstText();
const startBlockIsSelected =
@ -82,7 +86,6 @@ export function IndentationPlugin(): Plugin {
event.preventDefault();
handleIndent(editor, 'right');
} else if (event.key === 'Tab') {
event.preventDefault();
handleTabKey(event, editor, next);
} else {
return next();