From bc632f239dbdc6f236d26e09387ad0d5e6010d6e Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Tue, 11 Oct 2022 14:33:59 +0530 Subject: [PATCH] Tempo: Tab button doesn't work when in the Tags field (#56458) Co-authored-by: gitstart Co-authored-by: gitstart Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com> Co-authored-by: RubensRafael 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 Co-authored-by: Matheus Muniz Co-authored-by: Nitesh Singh Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com> Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com> --- .../grafana-ui/src/components/QueryField/QueryField.tsx | 2 +- packages/grafana-ui/src/slate-plugins/indentation.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/QueryField/QueryField.tsx b/packages/grafana-ui/src/components/QueryField/QueryField.tsx index 210e35bfbdf..6692bb86966 100644 --- a/packages/grafana-ui/src/components/QueryField/QueryField.tsx +++ b/packages/grafana-ui/src/components/QueryField/QueryField.tsx @@ -192,7 +192,7 @@ export class UnThemedQueryField extends PureComponent, 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();