@rc-component/select
Advanced tools
+15
-1
@@ -276,5 +276,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
| } | ||
| // Skip creating temp tag option if it matches a disabled option value | ||
| if (valueOptions.get(mergedSearchValue)?.disabled) { | ||
| return filteredOptions; | ||
| } | ||
| // Fill search value as option | ||
| return [createTagOption(mergedSearchValue), ...filteredOptions]; | ||
| }, [createTagOption, normalizedOptionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames]); | ||
| }, [createTagOption, normalizedOptionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames, valueOptions]); | ||
| const sorter = inputOptions => { | ||
@@ -417,2 +421,7 @@ const sortedOptions = [...inputOptions].sort((a, b) => filterSort(a, b, { | ||
| if (formatted) { | ||
| // Skip disabled options in tags mode | ||
| if (valueOptions.get(formatted)?.disabled) { | ||
| setSearchValue(''); | ||
| return; | ||
| } | ||
| const newRawValues = Array.from(new Set([...rawValues, formatted])); | ||
@@ -440,2 +449,7 @@ triggerChange(newRawValues); | ||
| } | ||
| // Filter out disabled option values in tags mode | ||
| if (mode === 'tags') { | ||
| patchValues = patchValues.filter(val => !valueOptions.get(val)?.disabled); | ||
| } | ||
| const newRawValues = Array.from(new Set([...rawValues, ...patchValues])); | ||
@@ -442,0 +456,0 @@ triggerChange(newRawValues); |
+15
-1
@@ -283,5 +283,9 @@ "use strict"; | ||
| } | ||
| // Skip creating temp tag option if it matches a disabled option value | ||
| if (valueOptions.get(mergedSearchValue)?.disabled) { | ||
| return filteredOptions; | ||
| } | ||
| // Fill search value as option | ||
| return [createTagOption(mergedSearchValue), ...filteredOptions]; | ||
| }, [createTagOption, normalizedOptionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames]); | ||
| }, [createTagOption, normalizedOptionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames, valueOptions]); | ||
| const sorter = inputOptions => { | ||
@@ -424,2 +428,7 @@ const sortedOptions = [...inputOptions].sort((a, b) => filterSort(a, b, { | ||
| if (formatted) { | ||
| // Skip disabled options in tags mode | ||
| if (valueOptions.get(formatted)?.disabled) { | ||
| setSearchValue(''); | ||
| return; | ||
| } | ||
| const newRawValues = Array.from(new Set([...rawValues, formatted])); | ||
@@ -447,2 +456,7 @@ triggerChange(newRawValues); | ||
| } | ||
| // Filter out disabled option values in tags mode | ||
| if (mode === 'tags') { | ||
| patchValues = patchValues.filter(val => !valueOptions.get(val)?.disabled); | ||
| } | ||
| const newRawValues = Array.from(new Set([...rawValues, ...patchValues])); | ||
@@ -449,0 +463,0 @@ triggerChange(newRawValues); |
+1
-1
| { | ||
| "name": "@rc-component/select", | ||
| "version": "1.8.0", | ||
| "version": "1.8.2", | ||
| "description": "React Select", | ||
@@ -5,0 +5,0 @@ "engines": { |
329844
0.31%7983
0.33%