[ACS-8899] Undercounted space from the top for view more button (#10403)

* [ACS-8065] tag creator unification

* [ACS-8065] test adjustments and after review fixes

* [ACS-8065] remove unnecessary style

* [ACS-8065] fix style selector

* [ACS-8065] remove transforming pipe and unnecessary styles

* [ACS-8065] fixes

* [ACS-8065] fixes

* [ACS-8065] fixes

* [ACS-8065] fix view more button placement

* [ACS-8065] fix view more button placement

* [ACS-8899] Undercounted space from the top for view more button

* [ACS-8899] Post rebase fixes

---------

Co-authored-by: tamaragruszka <tamara.gruszka@hyland.com>
Co-authored-by: MichalKinas <michal.kinas@hyland.com>
This commit is contained in:
jacekpluta
2024-12-11 12:18:23 +01:00
committed by GitHub
parent d6151308c9
commit 1cfbeff28c
3 changed files with 11 additions and 9 deletions

View File

@@ -181,7 +181,7 @@ export class DynamicChipListComponent implements OnChanges, OnInit, AfterViewIni
width += val._elementRef.nativeElement.getBoundingClientRect().width + chipMargin;
const availableSpace =
(index && index === chips.length - 1) || !this.paginationData ? containerWidth - viewMoreBtnWidth : containerWidth;
if (availableSpace >= width) {
if (availableSpace >= width - chipMargin) {
chipsToDisplay = (this.paginationData ? chipsToDisplay : index) + 1;
lastIndex++;
this.viewMoreButtonLeftOffset = width;
@@ -225,11 +225,13 @@ export class DynamicChipListComponent implements OnChanges, OnInit, AfterViewIni
if (this.paginationData?.hasMoreItems) {
const lastChipTop = this.matChips.last._elementRef.nativeElement.offsetTop;
if (this.moveLoadMoreButtonToNextRow) {
const buttonTopHeightCorrection = 5;
this.viewMoreButtonLeftOffset = 0;
this.viewMoreButtonTop = lastChipTop + viewMoreButton.offsetHeight;
this.viewMoreButtonTop = lastChipTop + viewMoreButton.offsetHeight + buttonTopHeightCorrection;
} else {
const buttonTopHeightCorrection = 3;
this.viewMoreButtonLeftOffset = this.viewMoreButtonLeftOffsetBeforeFlexDirection;
this.viewMoreButtonTop = lastChipTop;
this.viewMoreButtonTop = lastChipTop - buttonTopHeightCorrection;
}
} else {
this.viewMoreButtonLeftOffset = this.columnFlexDirection ? 0 : this.viewMoreButtonLeftOffsetBeforeFlexDirection;