Hi i'm trying to use this module in a meteor 1.2 project, but when i click the component for select an option,i get the following error message.
Select.js:193 Uncaught TypeError: Cannot read property 'offsetTop' of null
I used the example code for test in my project.
I'm able to use the components in Meteor 1.3, however none of the styles are getting imported... going to wait a little bit for Meteor to resolved some CSS import-from-external-library conflicts, before opening a new issue.
I debugged the code in Meteor 1.2 and while creating each <Option/> component the corresponding option has the ref='focused' , but when the options actually render there isn't any component with the ref equal to focus, and yet it hass the class is-focused and the prop isFocused=true.
The corresponding line of code in the source is 180:
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
let focusedOptionNode = ReactDOM.findDOMNode(this.refs.focused);
let menuNode = ReactDOM.findDOMNode(this.refs.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
this.hasScrolledToOption = true;
}
the condition is evaluating to true because this.refs.focused has a strange value (a ReactClassComponent Constructor according to the chrome tools), so it doesn't find any DOMNode.
This may be a problem related to React in Meteor 1.2. I tested it in 1.3 and the only problem is it has no style as mentioned above.
The component is still usable, but this prevents focusing on the selected value, so it can be annoying when using long lists.
Any update on this issue, we are experiencing the same problem
I experienced this issue when deving a symlinked library that had an old version of react-dom. The library was running 15, but the main project was 16. It's not super relevant to the actual bug but I was able to fix the error by upgrading the library. Just posting here as the error was a little confusing and google landed me here.
Hello -
In an effort to sustain the react-select project going forward, we're closing old issues / pull requests.
We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.
If you feel this issue / pull request is still relevant and you'd like us to review it, please leave a comment and we'll do our best to get back to you.
Most helpful comment
I experienced this issue when deving a symlinked library that had an old version of react-dom. The library was running 15, but the main project was 16. It's not super relevant to the actual bug but I was able to fix the error by upgrading the library. Just posting here as the error was a little confusing and google landed me here.