Skip to content

fix(Highlighter): auto toggle single item#693

Open
Kurtil wants to merge 1 commit intoThatOpen:mainfrom
Kurtil:patch-2
Open

fix(Highlighter): auto toggle single item#693
Kurtil wants to merge 1 commit intoThatOpen:mainfrom
Kurtil:patch-2

Conversation

@Kurtil
Copy link

@Kurtil Kurtil commented Feb 13, 2026

Description

The current Highlighter cannot auto toggle a single item. This is because the previous selection is cleared before the auto toggle picking logic is done.

Steps to reproduce:

  • setup the Highlighter with autoToggle on (or test on the official Highlighter example)
  • select an item
  • select the same item twice
    -> Nothing change, the item is still highlighted

Workaround: pressing the multiple key (ctrl on the example) let the item be deselected. This is because the multiple config is then interpreted as not removePrevious, preventing the clear to be done.

Solution:
If picking and auto toggle are true, prevent clearing the selection if the new requested selection is the same as the current one. Letting the code take the same path as if multiple is pressed, deselecting the item 🎉 .

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following:

  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Follow the Conventional Commits v1.0.0 standard for PR naming (e.g. feat(examples): add hello-world example).
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant