1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fine-tune rootMargin to catch intersections on small screen

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-03-12 15:25:23 +03:00
parent 6fd20bd169
commit 5bf3d3a188
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ export class Preferences extends React.Component {
render() {
const { preferences } = userStore;
const header = <h2>Preferences</h2>;
const rootMargin = "80px 0px -85%"; // Cut header size from the top and 85% from the bottom of viewport
const rootMargin = "80px 0px -80%";
let defaultShell = process.env.SHELL || process.env.PTYSHELL;
if (!defaultShell) {

View File

@ -8,7 +8,7 @@ interface Props extends React.DOMAttributes<HTMLElement> {
rootMargin?: string // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#creating_an_intersection_observer
}
export const ScrollSpy = observer(({ render, rootMargin = "0px 0px -85%" }: Props) => {
export const ScrollSpy = observer(({ render, rootMargin = "0px 0px -80%" }: Props) => {
const parent = useRef<HTMLDivElement>();
const sections = useRef<NodeListOf<HTMLElement>>();
const [tree, setTree] = useState<NavigationTree[]>([]);