Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* fixed; issue with value object not being passed to `handleRequired`, thanks [Andrew Hite](https://github.com/andyhite)
* fixed; the menu-outer container is no longer rendered when it does not contain anything, thanks [Kuan](https://github.com/khankuan)
* improved; better support for IE8 in styles, thanks [Rockallite Wulf](https://github.com/rockallite)
* fixed; when opening the menu, scroll to the top of the group containing the focused option rather than to the option itself, thanks [mattics](https://github.com/mattics)

## v1.0.0-beta12 / 2016-04-02

Expand Down
3 changes: 2 additions & 1 deletion dist/react-select-plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,9 @@ var Select = _react2['default'].createClass({
// focus to the selected option
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
var focusedOptionNode = _reactDom2['default'].findDOMNode(this.refs.focused);
var focusedOptionParent = focusedOptionNode.parentElement;
var menuNode = _reactDom2['default'].findDOMNode(this.refs.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
menuNode.scrollTop = focusedOptionParent.className === 'Select-menu' ? focusedOptionNode.offsetTop : focusedOptionParent.offsetTop;
this.hasScrolledToOption = true;
} else if (!this.state.isOpen) {
this.hasScrolledToOption = false;
Expand Down
4 changes: 2 additions & 2 deletions dist/react-select-plus.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion examples/dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,9 @@ var Select = _react2['default'].createClass({
// focus to the selected option
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
var focusedOptionNode = _reactDom2['default'].findDOMNode(this.refs.focused);
var focusedOptionParent = focusedOptionNode.parentElement;
var menuNode = _reactDom2['default'].findDOMNode(this.refs.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
menuNode.scrollTop = focusedOptionParent.className === 'Select-menu' ? focusedOptionNode.offsetTop : focusedOptionParent.offsetTop;
this.hasScrolledToOption = true;
} else if (!this.state.isOpen) {
this.hasScrolledToOption = false;
Expand Down
3 changes: 2 additions & 1 deletion examples/dist/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,9 @@ var Select = _react2['default'].createClass({
// focus to the selected option
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
var focusedOptionNode = _reactDom2['default'].findDOMNode(this.refs.focused);
var focusedOptionParent = focusedOptionNode.parentElement;
var menuNode = _reactDom2['default'].findDOMNode(this.refs.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
menuNode.scrollTop = focusedOptionParent.className === 'Select-menu' ? focusedOptionNode.offsetTop : focusedOptionParent.offsetTop;
this.hasScrolledToOption = true;
} else if (!this.state.isOpen) {
this.hasScrolledToOption = false;
Expand Down
3 changes: 2 additions & 1 deletion lib/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ var Select = _react2['default'].createClass({
// focus to the selected option
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
var focusedOptionNode = _reactDom2['default'].findDOMNode(this.refs.focused);
var focusedOptionParent = focusedOptionNode.parentElement;
var menuNode = _reactDom2['default'].findDOMNode(this.refs.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
menuNode.scrollTop = focusedOptionParent.className === 'Select-menu' ? focusedOptionNode.offsetTop : focusedOptionParent.offsetTop;
this.hasScrolledToOption = true;
} else if (!this.state.isOpen) {
this.hasScrolledToOption = false;
Expand Down
5 changes: 4 additions & 1 deletion src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,11 @@ const Select = React.createClass({
// focus to the selected option
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
let focusedOptionNode = ReactDOM.findDOMNode(this.refs.focused);
let focusedOptionParent = focusedOptionNode.parentElement;
let menuNode = ReactDOM.findDOMNode(this.refs.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
menuNode.scrollTop = focusedOptionParent.className === 'Select-menu' ?
focusedOptionNode.offsetTop :
focusedOptionParent.offsetTop;
this.hasScrolledToOption = true;
} else if (!this.state.isOpen) {
this.hasScrolledToOption = false;
Expand Down