Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-select

Package Overview
Dependencies
Maintainers
9
Versions
469
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-select - npm Package Compare versions

Comparing version 14.7.1 to 14.7.2

6

es/Select.js

@@ -53,3 +53,3 @@ import _extends from "@babel/runtime/helpers/esm/extends";

import SelectContext from "./SelectContext";
import { hasValue, toArray } from "./utils/commonUtil";
import { hasValue, isComboNoValue, toArray } from "./utils/commonUtil";
import { fillFieldNames, flattenOptions, injectPropsWithOption } from "./utils/valueUtil";

@@ -194,4 +194,4 @@ import warningProps, { warningNullOptions } from "./utils/warningPropsUtil";

// combobox no need save value when it's no value
if (mode === 'combobox' && !((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.value)) {
// combobox no need save value when it's no value (exclude value equal 0)
if (mode === 'combobox' && isComboNoValue((_values$ = values[0]) === null || _values$ === void 0 ? void 0 : _values$.value)) {
return [];

@@ -198,0 +198,0 @@ }

@@ -7,2 +7,4 @@ import type { DisplayValueType } from '../BaseSelect';

export declare function hasValue(value: any): boolean;
/** combo mode no value judgment function */
export declare function isComboNoValue(value: any): boolean;
export declare function getTitle(item: DisplayValueType): string;

@@ -15,2 +15,7 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";

}
/** combo mode no value judgment function */
export function isComboNoValue(value) {
return !value && value !== 0;
}
function isTitleType(title) {

@@ -17,0 +22,0 @@ return ['string', 'number'].includes(_typeof(title));

@@ -202,4 +202,4 @@ "use strict";

// combobox no need save value when it's no value
if (mode === 'combobox' && !((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.value)) {
// combobox no need save value when it's no value (exclude value equal 0)
if (mode === 'combobox' && (0, _commonUtil.isComboNoValue)((_values$ = values[0]) === null || _values$ === void 0 ? void 0 : _values$.value)) {
return [];

@@ -206,0 +206,0 @@ }

@@ -7,2 +7,4 @@ import type { DisplayValueType } from '../BaseSelect';

export declare function hasValue(value: any): boolean;
/** combo mode no value judgment function */
export declare function isComboNoValue(value: any): boolean;
export declare function getTitle(item: DisplayValueType): string;

@@ -10,2 +10,3 @@ "use strict";

exports.isClient = exports.isBrowserClient = void 0;
exports.isComboNoValue = isComboNoValue;
exports.toArray = toArray;

@@ -28,2 +29,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

}
/** combo mode no value judgment function */
function isComboNoValue(value) {
return !value && value !== 0;
}
function isTitleType(title) {

@@ -30,0 +36,0 @@ return ['string', 'number'].includes((0, _typeof2.default)(title));

{
"name": "rc-select",
"version": "14.7.1",
"version": "14.7.2",
"description": "React Select",

@@ -5,0 +5,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc