mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +00:00
Fix jumping Scroller (#2305)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
4304066083
commit
c808457c30
@ -27,4 +27,4 @@
|
||||
"Enum": "Справочник",
|
||||
"Members": "Участники"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
import { beforeUpdate, afterUpdate, onDestroy, onMount } from 'svelte'
|
||||
import { resizeObserver } from '../resize'
|
||||
import { themeStore as themeOptions } from '@hcengineering/theme'
|
||||
import type { FadeOptions } from '../types'
|
||||
@ -203,6 +203,16 @@
|
||||
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
|
||||
const _resize = (): void => checkFade()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user