palantir/blueprint

[MultiSelect2 / TagInput] Deleting tags is performed in the wrong order after deleting

Open

#5,412 opened on Jul 5, 2022

View on GitHub
 (2 comments) (0 reactions) (0 assignees)TypeScript (2,167 forks)batch import
P3Package: corePackage: selectType: bughelp wanted

Repository metrics

Stars
 (20,263 stars)
PR merge metrics
 (Avg merge 43d 10h) (27 merged PRs in 30d)

Description

Environment

  • Package version(s): @blueprintjs/core v4.5.1
  • Operating System: macOS Monterey
  • Browser name and version: Google chrome 103.0.5060.53 (Build officiel) (x86_64),

Code Sandbox

Example

Steps to reproduce

  1. Create an app using tagInput or MultiSelect
  2. Add one or multiple tags
  3. Delete all
  4. Add tags agains
  5. Delete them (should goes in the wrong order)

Actual behavior

Using keyboard Backspace, after deleting all existing tags in a tagInput, when you try to add new one, the first added take "focus" or become active, and if you have more tags after it still this tag that will be delete first. You can still use keyboard "left" and "right" to change active tag.

Here is a short video :

https://user-images.githubusercontent.com/9548473/177285272-56e1b317-1229-4603-a666-63290ead1649.mov

Expected behavior

Delete operation always start from the tag closest to the cursor by default.

Contributor guide