Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!