Skip to content

Instantly share code, notes, and snippets.

View yashsharma04's full-sized avatar
🏠
Working from home

yash sharma yashsharma04

🏠
Working from home
View GitHub Profile
.rt-table::-webkit-scrollbar {
display: none;
}
.rt-table{
-ms-overflow-style: none;
scrollbar-width: none;
}
const paginationComp = document.querySelector(".footer-wrapper");
const ifInViewPort = isInViewport(paginationComp);
const scrollBar = document.getElementById("scroll-bar");
if (ifInViewPort) {
scrollBar.style.position = "static";
} else {
scrollBar.style.position = "fixed";
}
function isInViewport(element) {
const rect = element.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom - 62 <= (window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
);
}
handleScroll = () => {
const elm = document.getElementById("scroll-bar");
const scrollLeft = elm.scrollLeft;
const tableBody = document.querySelector(".rt-table");
tableBody.scrollLeft = scrollLeft;
}
getTableBodyWidth = () => {
const tableBody = document.querySelector(".rt-table");
if (tableBody) {return tableBody.scrollWidth;}
return 0;
}
.scrollbarContainer {
overflow: scroll;
position: fixed;
bottom: 0;
width: 100%;
z-index: 1;
}
.scrollbarChild {
height: 1px;
<div className="table"/>
<div id={"scroll-bar"} className={styles.scrollbarContainer} onScroll={this.handleScroll}>
<div style={{ width: this.getTableBodyWidth()}} className={styles.scrollbarChild} />
</div>
{
"expo": {
"name": "your app name",
"description": "your app desc",
....,
"ios": {
"supportsTablet": true
},
"android": {