calculateHeightToForm() {
    let startElement = document.body.firstElementChild;
    const lastElement = document.querySelector('form');

    let heightBeforeForm = 0;
    while (startElement !== lastElement) {
      if (startElement.getClientRects) {
        // check if position fixed style is active
        if (startElement.style.position && startElement.style.position === 'fixed') {
          continue;
        }
        const clientRects = startElement.getClientRects();
        if (clientRects && clientRects.length) {
          heightBeforeForm += clientRects[0].height;
        }
      }
      startElement = startElement.nextElementSibling;
    }
    return heightBeforeForm;
  }
/**
   * Calculates the height to from the first child of the
   * document body to the sharepoint form element
   * @return {Number} the height before the sharepoint form
   */
Calculates the height to from the first child of the
document body to the sharepoint form element
@return {Number} the height before the sharepoint form
Calculates the height to from the first child of the document body to the sharepoint form element @return { Number } the height before the sharepoint form
calculateHeightToForm() {
    let startElement = document.body.firstElementChild;
    const lastElement = document.querySelector('form');
    let heightBeforeForm = 0;
    while (startElement !== lastElement) {
      if (startElement.getClientRects) {
        if (startElement.style.position && startElement.style.position === 'fixed') {
          continue;
        }
        const clientRects = startElement.getClientRects();
        if (clientRects && clientRects.length) {
          heightBeforeForm += clientRects[0].height;
        }
      }
      startElement = startElement.nextElementSibling;
    }
    return heightBeforeForm;
  }
calculateHeightToForm ( ) { let startElement = document . body . firstElementChild ; const lastElement = document . querySelector ( 'form' ) ; let heightBeforeForm = 0 ; while ( startElement !== lastElement ) { if ( startElement . getClientRects ) { if ( startElement . style . position && startElement . style . position === 'fixed' ) { continue ; } const clientRects = startElement . getClientRects ( ) ; if ( clientRects && clientRects . length ) { heightBeforeForm += clientRects [ 0 ] . height ; } } startElement = startElement . nextElementSibling ; } return heightBeforeForm ; }
Calculates the height to from the first child of the
 document body to the sharepoint form element
 @return {Number} the height before the sharepoint form
Calculates the height to from the first child of the document body to the sharepoint form element @return { Number } the height before the sharepoint form
// check if position fixed style is active