odaptos_design_system 2.0.218 → 2.0.219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/odaptos_design_system.cjs.development.js +7 -4
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +7 -4
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Organisms/SingleSelect/SingleSelect.tsx +9 -6
|
@@ -53540,14 +53540,17 @@ const SingleSelect = ({
|
|
|
53540
53540
|
}));
|
|
53541
53541
|
},
|
|
53542
53542
|
filterOptions: (options, params) => {
|
|
53543
|
-
//
|
|
53544
|
-
|
|
53545
|
-
|
|
53543
|
+
// Si l'utilisateur tape quelque chose et qu'on a fullOptions, on utilise fullOptions
|
|
53544
|
+
if (params.inputValue && fullOptions) {
|
|
53545
|
+
return filter$2(fullOptions, params);
|
|
53546
|
+
}
|
|
53547
|
+
// Sinon on filtre normalement les options principales
|
|
53548
|
+
const filtered = filter$2(options, params);
|
|
53546
53549
|
const {
|
|
53547
53550
|
inputValue
|
|
53548
53551
|
} = params;
|
|
53549
53552
|
// Suggest the creation of a new value
|
|
53550
|
-
const isExisting =
|
|
53553
|
+
const isExisting = options.some(option => inputValue === option.label);
|
|
53551
53554
|
if (inputValue !== '' && !isExisting) {
|
|
53552
53555
|
if (canAddNewOption) filtered.push({
|
|
53553
53556
|
value: inputValue,
|