From 67dbaaff913c7bdd6d27640b80e1c56dfbab8846 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 26 Oct 2023 10:06:07 -0700 Subject: [PATCH] input_pill: Fix backspace with selected text. The logic added in b57ebe717effc920637d3e5853205729cdb4288d introduced a different bug, namely that if you had selected text in the input, Backspace would delete the input pill itself, not your selected text. Fix this, without re-introducing the old bug, by checking explicitly if there's a range selected before inspecting anchorOffset. Also improve the comments. Fixes #19544. --- web/src/input_pill.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/src/input_pill.ts b/web/src/input_pill.ts index 754d763ef9..76de9ff196 100644 --- a/web/src/input_pill.ts +++ b/web/src/input_pill.ts @@ -339,11 +339,14 @@ export function create(opts: InputPillCreateOptions): InputPillContainer(opts: InputPillCreateOptions): InputPillContainer