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

384
Visualizações
Type 'Node' is missing the following properties

What causes the following issue below ? Any idea guys ? Thanks. the issue is on clone = thead.cloneNode(true);

Type 'Node' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 227 more.

Also I am having issue with Cannot read properties of null (reading 'getBoundingClientRect')

Actually I am using angular but there is some custom things I need to do that is why I am doing this manual JS things.

#code snippet

let container = document.querySelector('#properties-content-left-container');
         container.addEventListener("scroll", () => {
     let filterChips = document.querySelector('#properties-filter-chips');
     let filterChipsBB = filterChips.getBoundingClientRect();
     let top = filterChipsBB.top + filterChipsBB.height;
     let table = document.querySelector('#table') as HTMLElement | null;
     let tableBB = table.getBoundingClientRect();
     let thead = table.querySelector('thead:not(.temporary)') as HTMLElement | null;;
     let gridContainer = document.querySelector('.grid-container');
     let clone = table.querySelector('thead.temporary') as HTMLElement | null;
      table.style.position = 'relative';
     if (tableBB.top < top) {
         if (thead.style.position != 'fixed') {
             thead.style.position = 'fixed';
             thead.style.top = top + 'px';
             thead.style.width = (gridContainer ? gridContainer.clientWidth : table.clientWidth)  + 'px';
             thead.style.maxWidth = (gridContainer ? gridContainer.clientWidth : table.clientWidth)  + 'px';
             thead.style.overflowX = 'auto';
         }

         if (!clone) {
             clone = thead.cloneNode(true);
             clone.classList.add('temporary');
             clone.style.opacity = '0';
             clone.style.top = '0';
             clone.style.position = 'sticky';
             clone.style.width = 'auto';
             clone.style.maxWidth = 'unset';
             table.prepend(clone);
         }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

For the first question, use type assertion to tell the compiler that the node is actually an HTMLElement

clone = thead.cloneNode(true) as HTMLElement

For the second question, check if either filterChips or table are null. Use debugger/console for that.

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