Skip to content
Verified Commit 40b05130 authored by Mark Florian's avatar Mark Florian
Browse files

fix(GlFilteredSearch): Token activation after destruction

This makes more intuitive the behaviour of the active token after
a token has been destroyed.

The previous behaviour was to always activate the previous token, unless
the token being deleted is the first one. This had two undesirable
effects:

1. If you click the close `x` button on a token, the previous token's
   value would now become active. This likely isn't what you want, and
   is what #1679 is
   about.
2. If an active token is not the first token, and you click the close
   `x` on the first token, the currently active token changes, because
   all tokens got shifted down by one index.

The new logic tries to maintain the active states of the tokens as-is,
unless it's not possible, or the way the token was destroyed implies the
previous token should be activated. That happens when a search term is
destroyed by pressing backspace once it's empty.

Addresses #1679.
parent ead7f216
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment