Skip to content

Fix: Trim input value in handleSearch to prevent duplicate tags with trailing spaces#6386

Open
pskliarenko wants to merge 1 commit into
select2:developfrom
pskliarenko:fix-trim-handleSearch
Open

Fix: Trim input value in handleSearch to prevent duplicate tags with trailing spaces#6386
pskliarenko wants to merge 1 commit into
select2:developfrom
pskliarenko:fix-trim-handleSearch

Conversation

@pskliarenko
Copy link
Copy Markdown

This pull request fixes an issue where duplicate tags are created due to leading or trailing spaces in the input.

  • Trimmed input value in handleSearch method in both dropdown/search.js and selection/search.js
  • Prevents duplicate tags caused by whitespace around user input
  • Keeps consistent behavior across dropdown and selection components

This pull request includes a:

  • Bug fix
  • New feature
  • Translation

The following changes were made:

  • Added $.trim() around the search input value in handleSearch
  • Updated two files to keep behavior consistent (dropdown/search.js, selection/search.js)

If this is related to an existing ticket, include a link to it as well:

  • No existing ticket, this is a small bugfix discovered during use

…uplicate tags

- Trimmed input value in handleSearch method in dropdown/search.js and selection/search.js
- Prevents duplicate tags caused by leading/trailing spaces on user input
- Keeps consistent behavior across dropdown and selection components
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