react-select-plus
Advanced tools
Comparing version 1.0.0-rc.3.patch5 to 1.0.0-rc.3.patch6
@@ -174,15 +174,26 @@ 'use strict'; | ||
var newInputValue = inputValue; | ||
if (onInputChange) { | ||
var value = onInputChange(newInputValue); | ||
// Note: != used deliberately here to catch undefined and null | ||
if (value != null && typeof value !== 'object') { | ||
newInputValue = '' + value; | ||
} | ||
} | ||
var transformedInputValue = newInputValue; | ||
if (ignoreAccents) { | ||
inputValue = (0, _utilsStripDiacritics2['default'])(inputValue); | ||
transformedInputValue = (0, _utilsStripDiacritics2['default'])(transformedInputValue); | ||
} | ||
if (ignoreCase) { | ||
inputValue = inputValue.toLowerCase(); | ||
transformedInputValue = transformedInputValue.toLowerCase(); | ||
} | ||
if (onInputChange) { | ||
onInputChange(inputValue); | ||
} | ||
this.loadOptions(transformedInputValue); | ||
return this.loadOptions(inputValue); | ||
// Return new input value, but without applying toLowerCase() to avoid modifying the user's view case of the input while typing. | ||
return newInputValue; | ||
} | ||
@@ -189,0 +200,0 @@ }, { |
@@ -1293,3 +1293,2 @@ /*! | ||
var isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen; | ||
if (this.props.multi && !options.length && valueArray.length && !this.state.inputValue) isOpen = false; | ||
var focusedOptionIndex = this.getFocusableOptionIndex(valueArray[0]); | ||
@@ -1296,0 +1295,0 @@ |
{ | ||
"name": "react-select-plus", | ||
"version": "1.0.0-rc.3.patch5", | ||
"version": "1.0.0-rc.3.patch6", | ||
"description": "A fork of react-select with support for option groups", | ||
@@ -5,0 +5,0 @@ "main": "lib/Select.js", |
@@ -142,16 +142,26 @@ import React, { Component, PropTypes } from 'react'; | ||
const { ignoreAccents, ignoreCase, onInputChange } = this.props; | ||
let newInputValue = inputValue; | ||
if (onInputChange) { | ||
const value = onInputChange(newInputValue); | ||
// Note: != used deliberately here to catch undefined and null | ||
if (value != null && typeof value !== 'object') { | ||
newInputValue = '' + value; | ||
} | ||
} | ||
let transformedInputValue = newInputValue; | ||
if (ignoreAccents) { | ||
inputValue = stripDiacritics(inputValue); | ||
transformedInputValue = stripDiacritics(transformedInputValue); | ||
} | ||
if (ignoreCase) { | ||
inputValue = inputValue.toLowerCase(); | ||
transformedInputValue = transformedInputValue.toLowerCase(); | ||
} | ||
if (onInputChange) { | ||
onInputChange(inputValue); | ||
} | ||
this.loadOptions(transformedInputValue); | ||
return this.loadOptions(inputValue); | ||
// Return new input value, but without applying toLowerCase() to avoid modifying the user's view case of the input while typing. | ||
return newInputValue; | ||
} | ||
@@ -158,0 +168,0 @@ |
@@ -1186,3 +1186,2 @@ /*! | ||
let isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen; | ||
if (this.props.multi && !options.length && valueArray.length && !this.state.inputValue) isOpen = false; | ||
const focusedOptionIndex = this.getFocusableOptionIndex(valueArray[0]); | ||
@@ -1189,0 +1188,0 @@ |
@@ -436,2 +436,11 @@ 'use strict'; | ||
}); | ||
it('should change the value when onInputChange returns a value', () => { | ||
const onInputChange = sinon.stub().returns('2'); | ||
const instance = createControl({ | ||
onInputChange, | ||
}); | ||
typeSearchText('1'); | ||
return expect(filterInputNode.value, 'to equal', '2'); | ||
}); | ||
}); | ||
@@ -438,0 +447,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
2
586566
90
12955