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

142
Visualizações
javascript reposition overflow table scroll position

I am drawing a table using a function after data is received from a GET request. After I draw the table, I want to hold the scroll position relative to the previous table that was there before (all tables have overflow:auto;).

The way I overcome this problem is as follows:

  1. listen to the scroll
  2. store the scroll position in sessionStorage
  3. After the new table is drawn, I use .scrolLeft = sessionStorage.getItem('PosY')

This works fine as it does what I want it to do, but I get the following from Chrome Dev.

[Violation] Forced reflow while executing JavaScript took 51ms

I understand why I get this from Chrome Dev. but I want to know if there is another way to do this that will not give me this [Violation]

I have looked into listening to the DOM and repositioning upon changes, but this gives the same [Violation]

Any suggestions would be much appreciated, especially if there is some simple CSS.

No jQuery OR other Libraries, please.

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