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

169
Views
Bounding Rect position not match real element position

I got a strange problem with bounding box. As you can see on screenshot - the position of the bounding box of ad_agency is 1-2 pixels to the right of the position of the real element. I have no odd margins, paddings and etc, all are regular. Little strip(4px in height) below Ad_agency token/chip is positioned from it .getBoundingClientRect() and its width equal to the width of token. Looks like visual width of chips is less than its bounding box width and it move all past elements out of bounding box (somehow). If i set const width (for example width: 150px;) - problem disappear, but any other options for width gives this bug. enter image description here enter image description here enter image description here

I using typescript, mobx, react, css.

const Container = styled(CFlex)<{color: string}>`
    height: 28px;
    background-color: ${props => props.color};
    border-radius: 2px;
    display: inline-flex;
    color: white;
    margin-right: 12px;
    align-items: center;
    position: relative;
    z-index: 20;
    &:hover {
      z-index: 23;
}`

don't know if it matters, i use react clone to insert token and add to it mouse events:

{React.cloneElement(this.props.children, {
                onMouseLeave: this.referenceMouseHandler,
                onMouseEnter: (event) => this.referenceMouseHandler(event, true),
            })}

where this.props.children = token

Do anyone know how to solve this problem?

Minimum version where problem occurs(looks like content positioning wrong): enter image description here

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