feature(search): Include option descriptions in search when searchNormalize is true; fix add-new-option crash#464
Open
gnbm wants to merge 4 commits intosa-si-dev:masterfrom
Open
feature(search): Include option descriptions in search when searchNormalize is true; fix add-new-option crash#464gnbm wants to merge 4 commits intosa-si-dev:masterfrom
gnbm wants to merge 4 commits intosa-si-dev:masterfrom
Conversation
…ix allowNewOption crash - Precompute descriptionNormalized/valueNormalized for consistent diacritic matching - Fix beforeSelectNewValue when temp new option removed during single-select close
Covers: description match when searchNormalize=false, no match for normalized query when false, match for normalized query when true.
Clarify in properties.md and types that searchNormalize applies to both label and description. Add "Description search normalize" example with diacritic data.
Clarify in properties.md and types that searchNormalize applies to both label and description. Add "Description search normalize" example with diacritic data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature: Option descriptions in search when
searchNormalizeis trueBefore
With
searchNormalize: true, only labels were normalized for search. Descriptions were matched withtoLowerCase()only, so diacritics were not normalized.Example: Searching
bruleedid not match an option with descriptionCrème brûlée.After
Descriptions are normalized the same way as labels when
searchNormalizeis true. PrecomputeddescriptionNormalizedinsetOptions()andgetOptionObj(), and used inisOptionVisible().Example: Searching
bruleenow matchesCrème brûlée.Changes
descriptionNormalizedandvalueNormalizedwhen options are preparedisOptionVisible()for consistent diacritic-insensitive matchingsearchNormalizeapplies to both label and descriptionBug fix: Crash when adding a new option in single-select
Before
Selecting the "add new option" item in single-select could throw:
The displayed value was sometimes wrong or missing.
After
If the temporary new option was removed before
beforeSelectNewValue()runs (e.g. when dropdown closes and search is cleared), we re-add the option viasetNewOption(selectedValue)and mark it selected. No crash, and the value displays correctly.Changes
getNewOption()inbeforeSelectNewValue()selectedValueexists, re-add the option and set it as selectedTest cases
matches descriptions as-is when searchNormalize is falsebrûmatches option with descriptionCrème brûléedoes not normalize descriptions when searchNormalize is falsebruleedoes not match whensearchNormalizeis falsenormalizes descriptions when searchNormalize is truebruleematchesCrème brûléewhensearchNormalizeis trueadd a new option(Allow to add new option)Option not exist, select it, value text showsOption not existwithout crashValidations
Ran regression scenarios in the documentation using the branch - ✅
Run automated tests - ✅