From c66a23ea3106901a9f77a0b8c54e9d824a726b7b Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Thu, 12 Sep 2019 09:36:57 +0200 Subject: [PATCH] DataLinksInput - change the way enter key is handled (#18985) --- .../grafana-ui/src/components/DataLinks/DataLinkInput.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx b/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx index 08d466c35ae..c3463275cf6 100644 --- a/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx +++ b/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx @@ -111,11 +111,13 @@ export const DataLinkInput: React.FC = ({ value, onChange, s setShowingSuggestions(true); } - if (event.key === 'Backspace') { + if (event.key === 'Enter') { + // Preventing entering a new line + // As of https://github.com/ianstormtaylor/slate/issues/1345#issuecomment-340508289 + return false; + } else { // @ts-ignore return; - } else { - return true; } };