Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
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;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I have resolve this issue by using given below props of Dropdown component

defaultHighlightedIndex={0}
highlightedIndex={selectedIndex}

Note: these props will only works if u are using single selection Dropdown.

for multiple select Dropdown, u can use

defaultActiveSelectedIndex={0}
activeSelectedIndex={selectedIndex}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda