-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui5-list): introduce "growing" property (#2950)
Similar to the ui5-table, now the ui5-list provides growing property with 3 available options: Button, Scroll, None. As a side effect, it allows developers to set "max-height, overflow: auto" and the "load-more" still working as expected, fixing the referenced SF request #2882. Previously not possible as the List used to listen for the "scroll" of its internal container, which could not be influenced by these external styles. FIXES: #2882 BREAKING_CHANGES: The "infiniteScroll" property has been removed, use growing="Scroll" instead.
- Loading branch information
Showing
36 changed files
with
587 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Determines if the element is within the viewport. | ||
* @param el {HTMLElement} | ||
*/ | ||
const isElementInView = el => { | ||
const rect = el.getBoundingClientRect(); | ||
|
||
return ( | ||
rect.top >= 0 && rect.left >= 0 | ||
&& rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) | ||
&& rect.right <= (window.innerWidth || document.documentElement.clientWidth) | ||
); | ||
}; | ||
|
||
export default isElementInView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.