Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

111
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda