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

161
Visualizações
Aligning grid items in popper component

I am having trouble trying to align the option labels from the AutoComplete component so that they are aligned with their column headers in the popper component:

enter image description here

const PopperMy = function (props: PopperProps) {
    const { children, ...rest } = props;
    return (
        <Popper {...rest} placement="bottom-start">
            <Box sx={{
                display: 'grid',
                gridTemplateColumns: 'repeat(4, 1fr)',
                gap: 1,
                gridTemplateRows: 'auto',
                gridTemplateAreas: `"date order name items"
                "date order name items"`,
            }}>

                <Box sx={{ gridArea: 'date' }}><Typography>CreatedDate</Typography></Box>
                <Box sx={{ gridArea: 'order' }}><Typography>Order</Typography></Box>
                <Box sx={{ gridArea: 'name' }}><Typography>Name(email/phone)</Typography></Box>
                <Box sx={{ gridArea: 'items' }}><Typography>Items</Typography></Box>
            </Box>
            {children}
        </Popper>
    );
};

<Autocomplete
                PopperComponent={PopperMy}                   
                renderOption={(props, option: any) => {
                    return (
                        <li {...props} key={option.id} >
                            <Box sx={{ gridArea: 'items' }}>{convertToDateTime(option.createdtime).toFormat('d MMM HH:mm')}</Box>
                            <Box sx={{ gridArea: 'order' }}>{option.order}</Box>
                            <Box sx={{ gridArea: 'name' }}>{option.name}({option.email}/{option.phone})</Box>
                            <Box sx={{ gridArea: 'date' }}>{option.itemlist}</Box>
                        </li>

                    );

                }      
            />
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Turn each value into an element then set a max-width and min-width for each value in order to make sure they are aligned.

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