mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +00:00
Fix jumping Scroller (#2305)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
4304066083
commit
c808457c30
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onDestroy, onMount } from 'svelte'
|
import { beforeUpdate, afterUpdate, onDestroy, onMount } from 'svelte'
|
||||||
import { resizeObserver } from '../resize'
|
import { resizeObserver } from '../resize'
|
||||||
import { themeStore as themeOptions } from '@hcengineering/theme'
|
import { themeStore as themeOptions } from '@hcengineering/theme'
|
||||||
import type { FadeOptions } from '../types'
|
import type { FadeOptions } from '../types'
|
||||||
@ -203,6 +203,16 @@
|
|||||||
if (divScroll) divScroll.removeEventListener('scroll', checkFade)
|
if (divScroll) divScroll.removeEventListener('scroll', checkFade)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let oldTop: number
|
||||||
|
beforeUpdate(() => {
|
||||||
|
if (divBox && divScroll) oldTop = divScroll.scrollTop
|
||||||
|
})
|
||||||
|
afterUpdate(() => {
|
||||||
|
if (divBox && divScroll) {
|
||||||
|
if (oldTop !== divScroll.scrollTop) divScroll.scrollTop = oldTop
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
let divHeight: number
|
let divHeight: number
|
||||||
const _resize = (): void => checkFade()
|
const _resize = (): void => checkFade()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user