File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
9
9
10
10
## [ Released]
11
11
12
+ ## [ 1.9.29] - 2023-10-20
13
+
14
+ ### Changed
15
+
16
+ - Changed behaviour of ComboBox autocomplete: spaces are trimmed from search input and matching is only performed against the start of option labels
17
+
12
18
## [ 1.9.28] - 2023-10-05
13
19
14
20
### Changed
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @opetushallitus/kieli-ja-kaantajatutkinnot.shared" ,
3
- "version" : " 1.9.28 " ,
3
+ "version" : " 1.9.29 " ,
4
4
"description" : " Shared Frontend Package" ,
5
5
"exports" : {
6
6
"./components" : " ./src/components/index.tsx" ,
Original file line number Diff line number Diff line change 1
1
import {
2
2
Autocomplete ,
3
3
AutocompleteProps ,
4
+ createFilterOptions ,
4
5
FormControl ,
5
6
FormHelperText ,
6
7
TextField ,
@@ -47,6 +48,8 @@ const isOptionEqualToValue = (
47
48
}
48
49
} ;
49
50
51
+ const filterOptions = createFilterOptions ( { matchFrom : 'start' , trim : true } ) ;
52
+
50
53
export const valueAsOption = ( value : string ) => ( {
51
54
value : value ,
52
55
label : value ,
@@ -74,6 +77,7 @@ export const ComboBox = ({
74
77
getOptionLabel = { getOptionLabel }
75
78
isOptionEqualToValue = { isOptionEqualToValue }
76
79
options = { values }
80
+ filterOptions = { filterOptions }
77
81
renderInput = { ( params ) => (
78
82
< TextField
79
83
{ ...params }
@@ -119,6 +123,7 @@ export const LabeledComboBox = ({
119
123
getOptionLabel = { getOptionLabel }
120
124
isOptionEqualToValue = { isOptionEqualToValue }
121
125
options = { values }
126
+ filterOptions = { filterOptions }
122
127
renderInput = { ( params ) => (
123
128
< TextField
124
129
{ ...params }
You can’t perform that action at this time.
0 commit comments