mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-17 05:39:40 +03:00
change initialization bridging attribute name to prevent frameworks to change it back to empty
This commit is contained in:
@@ -103,7 +103,7 @@ const osInstance = OverlayScrollbars(document.querySelector('#myElement'), {});
|
||||
If you initialize OverlayScrollbars it needs a few milliseconds to create and append all the elements to the DOM.
|
||||
While this period the native scrollbars are still visible and are switched out after the initialization is finished. This is perceived as flickering.
|
||||
|
||||
To fix this behavior apply the `data-overlayscrollbars=""` attribute to the target element (and `html` element if the target element is `body`).
|
||||
To fix this behavior apply the `data-overlayscrollbars-initialize` attribute to the target element (and `html` element if the target element is `body`).
|
||||
|
||||
### Initialization with an Object
|
||||
<details>
|
||||
|
||||
@@ -30,7 +30,7 @@ const mergeEventListeners = (emits: EventListeners, events: EventListeners) =>
|
||||
|
||||
@Component({
|
||||
selector: 'overlay-scrollbars, [overlay-scrollbars]', // https://angular.io/guide/styleguide#component-selectors
|
||||
host: { 'data-overlayscrollbars': '' },
|
||||
host: { 'data-overlayscrollbars-initialize': '' },
|
||||
template: `<div overlayScrollbars [options]="options" [events]="mergeEvents(events)" #content>
|
||||
<ng-content></ng-content>
|
||||
</div>`,
|
||||
|
||||
@@ -60,7 +60,7 @@ const OverlayScrollbarsComponent = <T extends keyof JSX.IntrinsicElements>(
|
||||
|
||||
return (
|
||||
// @ts-ignore
|
||||
<Tag data-overlayscrollbars="" {...other} ref={elementRef}>
|
||||
<Tag data-overlayscrollbars-initialize="" {...other} ref={elementRef}>
|
||||
<div ref={childrenRef}>{children}</div>
|
||||
</Tag>
|
||||
);
|
||||
|
||||
@@ -88,7 +88,7 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="element" ref="elementRef" data-overlayscrollbars="">
|
||||
<component data-overlayscrollbars-initialize="" :is="element" ref="elementRef">
|
||||
<div ref="slotRef">
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
||||
@@ -103,7 +103,7 @@ const osInstance = OverlayScrollbars(document.querySelector('#myElement'), {});
|
||||
If you initialize OverlayScrollbars it needs a few milliseconds to create and append all the elements to the DOM.
|
||||
While this period the native scrollbars are still visible and are switched out after the initialization is finished. This is perceived as flickering.
|
||||
|
||||
To fix this behavior apply the `data-overlayscrollbars=""` attribute to the target element (and `html` element if the target element is `body`).
|
||||
To fix this behavior apply the `data-overlayscrollbars-initialize` attribute to the target element (and `html` element if the target element is `body`).
|
||||
|
||||
### Initialization with an Object
|
||||
<details>
|
||||
|
||||
@@ -61,15 +61,15 @@
|
||||
.os-viewport {
|
||||
-ms-overflow-style: scrollbar !important;
|
||||
}
|
||||
[data-overlayscrollbars=''],
|
||||
[data-overlayscrollbars-initialize],
|
||||
[data-overlayscrollbars~='scrollbarHidden'],
|
||||
html.os-viewport-scrollbar-hidden,
|
||||
.os-viewport-scrollbar-hidden.os-environment,
|
||||
.os-viewport-scrollbar-hidden.os-viewport {
|
||||
scrollbar-width: none !important;
|
||||
}
|
||||
[data-overlayscrollbars='']::-webkit-scrollbar,
|
||||
[data-overlayscrollbars='']::-webkit-scrollbar-corner,
|
||||
[data-overlayscrollbars-initialize]::-webkit-scrollbar,
|
||||
[data-overlayscrollbars-initialize]::-webkit-scrollbar-corner,
|
||||
[data-overlayscrollbars~='scrollbarHidden']::-webkit-scrollbar,
|
||||
[data-overlayscrollbars~='scrollbarHidden']::-webkit-scrollbar-corner,
|
||||
html.os-viewport-scrollbar-hidden::-webkit-scrollbar,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Html, Head, Main, NextScript } from 'next/document';
|
||||
|
||||
const Document = () => (
|
||||
<Html lang="en" data-overlayscrollbars="">
|
||||
<Html lang="en" data-overlayscrollbars-initialize="">
|
||||
<Head />
|
||||
<body data-overlayscrollbars="">
|
||||
<body data-overlayscrollbars-initialize="">
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user