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

176
Visualizações
How can I disable React-Select dropdown values from showing when clicking icons?

Using react-select we have some options that have a callback and when clicked open a separate modal. We've created a custom MultiValueLabel which has a callback to the onedit

MultiValueLabel: props => {
    const { classes } = props.selectProps as unknown as CustomSelectProps;
    const item = props.data as InternalCustomSelectItem;
    return (
        <div {...props.innerProps} onClick={item.onEdit} title={item.title ?? item.name}>
            {item.icon && <div className={classes.valueIcon}>{item.icon}</div>}
            {item.name}
        </div>
    );
},

The callback looks something like this:

    onEdit: async (groupKey: string) => {
        const groupForEdit = (await groupForEdit(groupKey)).value;
        return dispatch(ModalActions.showModal(CommonModalTypes.filterModal, { editingGroup: groupForEdit }));
    },

I would like to stop the other options from appearing when clicking these objects because showing the modal AND the dropdowns is a lot going on when really the modal is the only thing actionable.

I've tried a few variations of e.stopPropagation(); or e.preventDefault(); but none of them seem to stop the options from appearing. Anyone done something similar?

about 4 years ago · Juan Pablo Isaza
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