From 0b822478b6a65814c250b47f604a0b429b095c6b Mon Sep 17 00:00:00 2001 From: Kavindu Nilshan <114523187+kavindunilshan@users.noreply.github.com> Date: Thu, 25 Jul 2024 21:36:23 +0530 Subject: [PATCH] Resolved the issue stated in issue #90426. (#90465) * Resolved the issue stated in issue #90426. * Method created to get the length of the url. * Applied the length logic and intentional fall through in switch. * Changed the way length calculated Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com> * Remove un-used method getUrlLength * Refactoring --------- Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com> --- packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx b/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx index 81f03efc4f4..96c442a3458 100644 --- a/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx +++ b/packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx @@ -132,6 +132,9 @@ export const DataLinkInput = memo( switch (event.key) { case 'Backspace': + if (stateRef.current.linkUrl.focusText.getText().length === 1) { + next(); + } case 'Escape': setShowingSuggestions(false); return setSuggestionsIndex(0);