Skip to content

Commit e06ea57

Browse files
committed
Updating build
1 parent 7013005 commit e06ea57

File tree

6 files changed

+413
-405
lines changed

6 files changed

+413
-405
lines changed

dist/react-select.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,10 +1765,12 @@ var Select = (0, _createReactClass2['default'])({
17651765

17661766
var divProps = _objectWithoutProperties(_props$inputProps, ['inputClassName']);
17671767

1768+
var _ariaOwns = (0, _classnames2['default'])(_defineProperty({}, this._instancePrefix + '-list', isOpen));
1769+
17681770
return _react2['default'].createElement('div', _extends({}, divProps, {
17691771
role: 'combobox',
17701772
'aria-expanded': isOpen,
1771-
'aria-owns': isOpen ? this._instancePrefix + '-list' : this._instancePrefix + '-value',
1773+
'aria-owns': _ariaOwns,
17721774
'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value',
17731775
className: className,
17741776
tabIndex: this.props.tabIndex || 0,
@@ -1792,7 +1794,8 @@ var Select = (0, _createReactClass2['default'])({
17921794
},
17931795

17941796
renderClear: function renderClear() {
1795-
if (!this.props.clearable || !this.props.value || this.props.value === 0 || this.props.multi && !this.props.value.length || this.props.disabled || this.props.isLoading) return;
1797+
1798+
if (!this.props.clearable || this.props.value === undefined || this.props.value === null || this.props.multi && !this.props.value.length || this.props.disabled || this.props.isLoading) return;
17961799
var clear = this.props.clearRenderer();
17971800

17981801
return _react2['default'].createElement(
@@ -1910,11 +1913,12 @@ var Select = (0, _createReactClass2['default'])({
19101913
var options = this._visibleOptions;
19111914
if (!options.length) return null;
19121915

1916+
var valueKey = this.props.valueKey;
19131917
var focusedOption = this.state.focusedOption || selectedOption;
19141918
if (focusedOption && !focusedOption.disabled) {
19151919
var focusedOptionIndex = -1;
19161920
options.some(function (option, index) {
1917-
var isOptionEqual = option.value === focusedOption.value;
1921+
var isOptionEqual = option[valueKey] === focusedOption[valueKey];
19181922
if (isOptionEqual) {
19191923
focusedOptionIndex = index;
19201924
}

dist/react-select.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/dist/bundle.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,10 +2041,12 @@ var Select = (0, _createReactClass2['default'])({
20412041

20422042
var divProps = _objectWithoutProperties(_props$inputProps, ['inputClassName']);
20432043

2044+
var _ariaOwns = (0, _classnames2['default'])(_defineProperty({}, this._instancePrefix + '-list', isOpen));
2045+
20442046
return _react2['default'].createElement('div', _extends({}, divProps, {
20452047
role: 'combobox',
20462048
'aria-expanded': isOpen,
2047-
'aria-owns': isOpen ? this._instancePrefix + '-list' : this._instancePrefix + '-value',
2049+
'aria-owns': _ariaOwns,
20482050
'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value',
20492051
className: className,
20502052
tabIndex: this.props.tabIndex || 0,
@@ -2068,7 +2070,8 @@ var Select = (0, _createReactClass2['default'])({
20682070
},
20692071

20702072
renderClear: function renderClear() {
2071-
if (!this.props.clearable || !this.props.value || this.props.value === 0 || this.props.multi && !this.props.value.length || this.props.disabled || this.props.isLoading) return;
2073+
2074+
if (!this.props.clearable || this.props.value === undefined || this.props.value === null || this.props.multi && !this.props.value.length || this.props.disabled || this.props.isLoading) return;
20722075
var clear = this.props.clearRenderer();
20732076

20742077
return _react2['default'].createElement(
@@ -2186,11 +2189,12 @@ var Select = (0, _createReactClass2['default'])({
21862189
var options = this._visibleOptions;
21872190
if (!options.length) return null;
21882191

2192+
var valueKey = this.props.valueKey;
21892193
var focusedOption = this.state.focusedOption || selectedOption;
21902194
if (focusedOption && !focusedOption.disabled) {
21912195
var focusedOptionIndex = -1;
21922196
options.some(function (option, index) {
2193-
var isOptionEqual = option.value === focusedOption.value;
2197+
var isOptionEqual = option[valueKey] === focusedOption[valueKey];
21942198
if (isOptionEqual) {
21952199
focusedOptionIndex = index;
21962200
}

0 commit comments

Comments
 (0)