diff --git a/CHANGELOG.md b/CHANGELOG.md index 362e3e233bf..d2c0598c66a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes for each version of this project will be documented in this file. +## 21.2.28 + +### Bug Fixes + +- `IgxForOfDirective` + - In Safari, the horizontal scrollbar of a horizontally virtualized `igxFor` is now visible and usable when the list first renders. Previously it was collapsed until change detection ran again. + ## 21.2.27 ### Bug Fixes diff --git a/projects/igniteui-angular/core/src/core/styles/components/_common/_igx-vhelper.scss b/projects/igniteui-angular/core/src/core/styles/components/_common/_igx-vhelper.scss index 5c623bf1e34..fa1b4379b0d 100644 --- a/projects/igniteui-angular/core/src/core/styles/components/_common/_igx-vhelper.scss +++ b/projects/igniteui-angular/core/src/core/styles/components/_common/_igx-vhelper.scss @@ -17,6 +17,7 @@ %vhelper--horizontal { width: 100%; + height: var(--vhelper-scrollbar-size); } %vhelper-content--vertical { diff --git a/projects/igniteui-angular/directives/src/directives/for-of/for_of.directive.spec.ts b/projects/igniteui-angular/directives/src/directives/for-of/for_of.directive.spec.ts index 4bfcf3bf975..77b594c972d 100644 --- a/projects/igniteui-angular/directives/src/directives/for-of/for_of.directive.spec.ts +++ b/projects/igniteui-angular/directives/src/directives/for-of/for_of.directive.spec.ts @@ -1710,10 +1710,11 @@ export class VirtualComponent { public isHorizontalScrollbarVisible() { const horizontalScrollbar = this.container.element.nativeElement.querySelector('igx-horizontal-virtual-helper'); /** - * Due to current implementation the height is automatically calculated. - * That's why when it's less than 16 there is no scrollbar + * The element height is set explicitly via CSS, so it is always present. + * Visibility is determined by whether the virtual content width exceeds the container width. + * BUG https://github.com/IgniteUI/igniteui-angular/issues/17216 */ - return horizontalScrollbar.offsetHeight >= 16; + return horizontalScrollbar.offsetWidth < horizontalScrollbar.children[0].offsetWidth; } }