Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V2] IE11 vertical scrollbar #2816

Closed
rogier2012 opened this issue Jul 20, 2018 · 8 comments
Closed

[V2] IE11 vertical scrollbar #2816

rogier2012 opened this issue Jul 20, 2018 · 8 comments
Assignees

Comments

@rogier2012
Copy link

Opening the first select component of the demo page in Internet Explorer 11 shows a scrollbar, but clicking on this scrollbar closes the selector menu.

@4dom2dom
Copy link

4dom2dom commented Aug 29, 2018

I have the same issue in IE11. Hope it will be get soon carried out. Do you have any idea to make a quick fix?

@4dom2dom
Copy link

The issue is discussed here #1020. Unfortunately, it is not fixed.

@andrey99z
Copy link

Here is quick patch for current version based on Rakid's code:

   componentDidMount() {
        const select = this.rs.select;
        if (!select.onInputBlurPatched) {
            const originalOnInputBlur = select.onInputBlur;
            select.onInputBlur = e => {
                if (select.menuListRef && select.menuListRef.contains(document.activeElement)) {
                    select.inputRef.focus();
                    return;
                }
                originalOnInputBlur(e);
            }
            select.onInputBlurPatched = true;
        }
    }

(assuming that this.rs is ref to React-select component)
HTH

@pohsoon
Copy link

pohsoon commented Oct 11, 2018

Nice. This quick patch works in my IE 11.

@M-Yankov
Copy link

M-Yankov commented Aug 13, 2019

Here is quick patch for current version based on Rakid's code:

   componentDidMount() {
        const select = this.rs.select;
        if (!select.onInputBlurPatched) {
            const originalOnInputBlur = select.onInputBlur;
            select.onInputBlur = e => {
                if (select.menuListRef && select.menuListRef.contains(document.activeElement)) {
                    select.inputRef.focus();
                    return;
                }
                originalOnInputBlur(e);
            }
            select.onInputBlurPatched = true;
        }
    }

(assuming that this.rs is ref to React-select component)
HTH

The code works good, but in my case I am using react-window to replace the MenuList component. In that case select.menuListRef is always null. Any idea how to fix this ?

Edit:

Actually I need to set the innerRef in the react-select. innerRef in that case means MenuListRef.

Here is what I have:

import { FixedSizeList as List } from 'react-window';

class MenuList extends React.Component {
  render() {
    return (
        <List
          outerRef={this.props.innerRef} // I needed only this row
          height={this.props.maxHeight}
          itemCount={this.props.children.length}
          itemSize={this.props.rowHeight}
      >
          {({ index, style }) => <div style={style}>{this.props.children[index]}</div>}
      </List>);
  }
}

export default MenuList;

And I use the react-select like:

import Select from 'react-select';
import MenuList from  '../../MenuList'

<Select
   components={ MenuList }
   // ...
>

Note:

The code in quotes was already implemented in react-select and I don't need it.

@andrey99z
Copy link

Upgrade to the current version? This seem to be fixed now and the patch is not needed anymore.

@M-Yankov
Copy link

M-Yankov commented Aug 14, 2019

Upgrade to the current version? This seem to be fixed now and the patch is not needed anymore.

Yes it's fixed, I was editing my previous comment with the solution I found, but obviously I forgot to click save 🤓 (Grateful that my browser keeps tabs and input data cached, bеcause electricity was accidentally stopped 😄 )

@bladey
Copy link
Contributor

bladey commented May 28, 2020

Hello -

In an effort to sustain the react-select project going forward, we're closing old issues.

We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our efforts towards the current major version.

If you aren't using the latest version of react-select please consider upgrading to see if it resolves any issues you're having.

However, if you feel this issue 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!

@bladey bladey closed this as completed May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants