React-select: Can't able to scroll while initial load custom dropdown

Created on 16 Apr 2020  路  3Comments  路  Source: JedWatson/react-select

<Select
name={subCat.name}
id={subCat._id}
classNamePrefix="react-select"
value={getSelectedkeywords(subCat.frontEndKeywords,cat._id)}
isMulti={true}
components={{MenuList,ValueContainer,Option,}}
onChange={(val) =>handleChangeKeyword(val,subCat,cat._id)}
getOptionLabel={(option) =>option.name}
getOptionValue={(option) => option._id}options={subCat.frontEndKeywords.map(
(keyword) => {
if (
activeKeywords.length >
0 &&
activeKeywords.indexOf(
keyword._id
) <
0
) {
keyword.isDisabled = true;
} else {
keyword.isDisabled = false;
}
return keyword;
}
)}
isSearchable={
true
}
styles={
customStyles
}
/>

inital load scroll is not working on mouse wheel, once option selection and again opening on dropdown mouse wheel scroll starts working

const MenuList = (props) => {
    return (
        <components.MenuList {...props}>
            <div style={{ height: 120 }}>
                <Scrollbars
                    style={{ zIndex: 9999 }}
                    renderThumbVertical={props => <div {...props} className="thumb-vertical" />}
                >
                    {props.children}</Scrollbars>
            </div>
        </components.MenuList>
    );
};

issubug-unconfirmed issureviewed

Most helpful comment

You can disable this behaviour by using the captureMenuScroll prop by setting its value to false
<Select captureMenuScroll={false} {...} />

All 3 comments

+1

You can disable this behaviour by using the captureMenuScroll prop by setting its value to false
<Select captureMenuScroll={false} {...} />

thanx for reply. its worked

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MindRave picture MindRave  路  3Comments

pgoldweic picture pgoldweic  路  3Comments

sampatbadhe picture sampatbadhe  路  3Comments

AchinthaReemal picture AchinthaReemal  路  3Comments

steida picture steida  路  3Comments