rc-cascader
Advanced tools
Comparing version 3.2.8 to 3.2.9
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
import * as React from 'react'; | ||
import { useBaseProps } from 'rc-select'; | ||
import KeyCode from "rc-util/es/KeyCode"; | ||
import { useBaseProps } from 'rc-select'; | ||
import { SEARCH_MARK } from '../hooks/useSearchOptions'; | ||
export default (function (ref, options, fieldNames, activeValueCells, setActiveValueCells, onKeyBoardSelect) { | ||
@@ -172,3 +173,13 @@ var _useBaseProps = useBaseProps(), | ||
if (validActiveValueCells.length) { | ||
onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]); | ||
var option = lastActiveOptions[lastActiveIndex]; // Search option should revert back of origin options | ||
var originOptions = (option === null || option === void 0 ? void 0 : option[SEARCH_MARK]) || []; | ||
if (originOptions.length) { | ||
onKeyBoardSelect(originOptions.map(function (opt) { | ||
return opt[fieldNames.value]; | ||
}), originOptions[originOptions.length - 1]); | ||
} else { | ||
onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]); | ||
} | ||
} | ||
@@ -175,0 +186,0 @@ |
@@ -18,5 +18,7 @@ "use strict"; | ||
var _rcSelect = require("rc-select"); | ||
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode")); | ||
var _rcSelect = require("rc-select"); | ||
var _useSearchOptions = require("../hooks/useSearchOptions"); | ||
@@ -189,3 +191,13 @@ var _default = function _default(ref, options, fieldNames, activeValueCells, setActiveValueCells, onKeyBoardSelect) { | ||
if (validActiveValueCells.length) { | ||
onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]); | ||
var option = lastActiveOptions[lastActiveIndex]; // Search option should revert back of origin options | ||
var originOptions = (option === null || option === void 0 ? void 0 : option[_useSearchOptions.SEARCH_MARK]) || []; | ||
if (originOptions.length) { | ||
onKeyBoardSelect(originOptions.map(function (opt) { | ||
return opt[fieldNames.value]; | ||
}), originOptions[originOptions.length - 1]); | ||
} else { | ||
onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]); | ||
} | ||
} | ||
@@ -192,0 +204,0 @@ |
{ | ||
"name": "rc-cascader", | ||
"version": "3.2.8", | ||
"version": "3.2.9", | ||
"description": "cascade select ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138699
2701