Fix autocomplete strict+allowInvalid click-away regression (#12284)#12285
Conversation
Move the finishEditing() override that discards edits on click-away from AutocompleteEditor to DropdownEditor. The override was unconditionally discarding typed values when the user clicked away from the editor, which is correct for Dropdown (selection list) but wrong for Autocomplete where click-away should commit the value. This restores the pre-v16.2 behavior where clicking away from an autocomplete cell saves the typed value, including invalid values when allowInvalid: true is set. Co-authored-by: Marek Martuszewski <sl01k@users.noreply.github.com>
commit: |
⚡ Performance Results
Regressions
|
|
@cursoragent test is failing fix it |
|
The PR is already up to date with the existing description. The fix has been pushed. Summary The failing CI test
|
Co-authored-by: Mateusz Wojczal <qunabu@users.noreply.github.com>
📦 PR Preview PackagesInstall packages from this PR (commit npm i https://pkg.pr.new/handsontable@12285
npm i https://pkg.pr.new/@handsontable/react-wrapper@12285
npm i https://pkg.pr.new/@handsontable/vue3@12285
npm i https://pkg.pr.new/@handsontable/angular-wrapper@12285📚 Examples
SSR Examples:
|
|
@cursoragent update changelog number to 12285 |
Co-authored-by: Mateusz Wojczal <qunabu@users.noreply.github.com>


Context
Fixes #12284 -- a regression introduced in v16.2.0 by PR #11873.
PR #11873 added a
finishEditing()override toAutocompleteEditorthat unconditionally discards the typed value when the user clicks away from the editor (to a different cell or outside the table). This was intended to make Autocomplete and Dropdown editors behave like a selection picker (discard on click-away), but it broke the established contract for Autocomplete cells configured withstrict: trueandallowInvalid: true.Root cause: The
finishEditing()override was placed inAutocompleteEditor, which is the parent class ofDropdownEditor. The "discard on click-away" behavior is correct for Dropdown (a pure selection list), but wrong for Autocomplete, which is a hybrid text/suggestion editor where click-away should commit the typed value.Fix: Move the
finishEditing()override fromAutocompleteEditortoDropdownEditor. This restores the pre-v16.2 behavior for Autocomplete (click-away saves the value) while keeping the intended Dropdown behavior (click-away discards).How has this been tested?
Types of changes
Related issue(s):
Affected project(s):
handsontable@handsontable/angular-wrapper@handsontable/react-wrapper@handsontable/vue3Checklist: