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

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

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 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!