'How to make the scrollbar to the top when opening the option list using the Dropdown from @fluentui/react-northstar

While opening the dropdown option list the scrollbar moves to the bottom. The last options are visible in the select option list.

Can anyone provide solutions for showing the list items scrollbar to the top most items?

import React from 'react'
import { Dropdown } from '@fluentui/react-northstar';

class someComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
        currentObject: "",
        inputItems: [
            'Robert Tolbert',
            'Wanda Howard',
            'Tim Deboer',
            'Amanda Brady',
            'Ashley McCarthy',
            'Cameron Evans',
            'Carlos Slattery',
            'Carole Poland',
            'Robin Counts',
            'Test 1',
            'Test 2',
            'Test 3',
            'Test 4',
            'Test 5'
          ]
    }
  }
  **Function Called when user selects the options**
  onChangeObjectHandler(event, data){
    const objectName = data.value.header;
    this.setState({ currentObject: objectName });
  }

  render() {
    return (
      <div>
        <Dropdown
            checkable
            onChange={this.onChangeObjectHandler}
            items={this.state.inputItems}
            value={{this.state.currentObject}}
            placeholder="Select your object
        />
      </div>
    );
  }
}
export default someComponent;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source