react-select does not auto scroll to the selected option

Viewed 3382

How can i use react-select to scroll to the selected option?

<Select
              matchProp='label'
              classes={classes}
              inputId="react-select-single"
              TextFieldProps={{
                InputLabelProps: {
                  htmlFor: 'react-select-single',
                  shrink: true,
                },
                disableUnderline: true
              }}
              options={options}
              components={components}
              value={single}
              onChange={handleChangeSingle}
            />
1 Answers

You can use the react-select property,

      menuShouldScrollIntoView={true}

Thank you.

Related