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

128
Visualizações
How to configure resize operation react-rnd

I work with react-rnd package to resize an object in a react app. I wonder is there a way to configure the resize operation.

This is the component I work on:

enter image description here

When I resize using right border, 'A' from 'VISA' becomes hidden and position of the left border stays at where it was.

enter image description here

When I resize from left border, I want 'V' to become hidden and position of the right border to stay where it was. Position stays as intended but 'A' becomes hidden instead. In other words, I would like to change x and width at the same time, to keep right border at same position and hide the right part of the element when resize from left border.

enter image description here

Is there a way to make 'V' hidden while keeping right border at the same position, something like below?

enter image description here

I configured the component using: https://www.npmjs.com/package/react-rnd

Configurations:

const style = {
    display: 'flex',
    position: 'relative',
    border: 'solid 1px #ddd',
    overflow: 'hidden',
};

const resizeDirections = {
    bottom: false,
    bottomLeft: false,
    bottomRight: false,
    left: true,
    right: true,
    top: false,
    topLeft: false,
    topRight: false,
}

Component:

return (
    <Rnd 
        style={style} 
        enableResizing={resizeDirections}
        children={<img id="visaImage" src={visa} alt=""></img>}
        default={{
            x:0,
            y:0,
            width: 250,
            height: 60,
        }}
    /> 
)
about 4 years ago · Santiago Trujillo
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