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

171
Visualizações
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
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