The height of the right block is not calculated

I need your help. I have a markup that consists of two parts: the bottom part my-bottom-properties-panel-container and the right part my-properties-panel. They are always attached to the bottom and to the right, and each of these parts has a resize functionality – we can increase or decrease the height of the lower block and the width of the right one. The right part of my-properties-panel is above the bottom, and if we increase the height of my-bottom-properties-panel-container, the height of my-properties-panel decreases and vice versa.

Now the problem is that if we resize the bottom part or change the 'display' condition : bottomLeftTabsCnt || bottomRightTabsCnt ? 'flex' : 'none' then the height of my-properties-panel is not calculated and the content is displayed incorrectly. The height of my-properties-panel should always be the full available height of the content, including the height of the bottom block.

enter image description here

Where exactly do I have a problem? Thank you very much

Typescript

startResizing(event: MouseEvent, direction: string) {
    this.resizing = true;
    this.resizeDirection = direction;
    event.preventDefault();
    document.addEventListener('mousemove', this.performResize);
    document.addEventListener('mouseup', this.stopResizing);
  }

  performResize = (event: MouseEvent) => {
    if (!this.resizing) return;

    let newHeight = window.innerHeight - event.clientY;
    newHeight = Math.max(150, newHeight);
    newHeight = Math.min(window.innerHeight * 0.85, newHeight);

    if (this.resizeDirection === 'top') {
      this.updateHeights(newHeight);
    } else if (this.resizeDirection === 'left') {
      const newWidth = window.innerWidth - event.clientX;
      this.updateWidths(newWidth);
    }

    this.updateLayout();
  }

  updateHeights(newHeight: number) {
    this.buttomStyle = { height: `${newHeight}px` };
    this.style.maxHeight = `calc(100% - ${newHeight}px)`;
    this.updateLayout();
    this.sizeButtomChange.emit(this.buttomStyle);
    this.sizeChange.emit(this.style)
  }


  updateWidths(newWidth: number) {
    this.style.width = `${newWidth}px`;
    this.sizeChange.emit(this.style);
  }

  updateLayout() {
    if (this.bottomRightTabsCnt || this.bottomLeftTabsCnt) {
      this.style.maxHeight = `calc(100% - ${this.buttomStyle['height']}px)`;
    } else {
      this.style.maxHeight = '100%';
    }
    this.sizeChange.emit(this.style);
  }


  stopResizing = () => {
    this.resizing = false;
    document.removeEventListener('mousemove', this.performResize);
    document.removeEventListener('mouseup', this.stopResizing);
  }

html

<div class="my-properties-panel" id="my-properties-panel-div-id" [ngStyle]="style">
    <div class="resize-handle-left" (mousedown)="startResizing($event, 'left')"></div>
    <app-properties-panel
            style="min-width: 400px;"
            [sizeChange]="sizeChange">
    </app-properties-panel>
</div>

<div class="my-buttom-properties-panel-container"
     [ngStyle]="{
         buttomStyle,
            'display' : bottomLeftTabsCnt || bottomRightTabsCnt ? 'flex' : 'none',
         }"
>
    <div class="resize-handle-top" (mousedown)="startResizing($event, 'top')"></div>
    <div class="my-buttom-properties-panel d-flex w-100" id="my-buttom-properties-panel-div-id" [ngStyle]="buttomStyle">
        <div [ngClass]="{'w-50': bottomRightTabsCnt, 'w-100': !bottomRightTabsCnt}">
            <app-properties-panel-buttom
                    id="my-properties-panel-div-buttom-id"
                    [sizeButtomChange]="sizeButtomChange">
            </app-properties-panel-buttom>
        </div>
        <div [ngClass]="{'w-50': bottomRightTabsCnt, 'w-0': bottomRightTabsCnt}">
            <app-properties-panel-buttom-right
                    id="my-properties-panel-div-buttom-right-id"
                    [sizeButtomChange]="sizeButtomChange"
            ></app-properties-panel-buttom-right>
        </div>
    </div>

</div>

Scss

.resize-handle-top, .resize-handle-left {
  position: absolute;
  background-color: rgba(243, 243, 243, 1);
  border: 2px;
}

.resize-handle-top {
  cursor: row-resize;
  width: 100%;
  height: 3px;
  bottom: 100%;
  left: 0;
  z-index: 30;
  margin-bottom: 2px;
}

.resize-handle-left {
  width: 3px;
  left: -5px;
  top: 0;
  bottom: 2px;
  cursor: ew-resize;
}

.my-properties-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 400px;
  min-width: 400px;
  z-index: 10;
  border-left: 1px solid rgba(204, 204, 204, 0);
  background-color: #fffffff0;
}

.my-buttom-properties-panel-container {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  z-index: 10;

  .my-buttom-properties-panel-div-id {
    display: flex;
  }
}

New contributor

Halland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật