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

382
Views
Al tipo 'Nodo' le faltan las siguientes propiedades

¿Qué causa el siguiente problema a continuación? ¿Alguna idea chicos? Gracias. el problema está en clone = thead.cloneNode(true);

Al tipo 'Nodo' le faltan las siguientes propiedades del tipo 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir y 227 más.

También tengo un problema con Cannot read properties of null (reading 'getBoundingClientRect')

En realidad, estoy usando angular, pero hay algunas cosas personalizadas que debo hacer, por eso estoy haciendo este manual de JS.

#fragmento de código

 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 answers
Answer question

0

Para la primera pregunta, use la aserción de tipo para decirle al compilador que el nodo es en realidad un HTMLElement

 clone = thead.cloneNode(true) as HTMLElement

Para la segunda pregunta, verifique si filterChips o table son nulos. Use depurador/consola para eso.

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