mirror of
https://github.com/harness/drone.git
synced 2025-05-12 15:10:09 +08:00
fix: [code-886]: tmp fix for scrollintoviewifneeded (#585)
This commit is contained in:
parent
0fda028070
commit
211202bc0c
@ -38,7 +38,7 @@ const toolbar: ToolbarItem[] = [
|
||||
]
|
||||
|
||||
interface MarkdownEditorWithPreviewProps {
|
||||
className?: string,
|
||||
className?: string
|
||||
value?: string
|
||||
onChange?: (value: string) => void
|
||||
onSave?: (value: string) => void
|
||||
@ -311,8 +311,8 @@ function scrollToAndSetCursorToEnd(
|
||||
if (!dom) {
|
||||
return
|
||||
}
|
||||
|
||||
dom.scrollIntoViewIfNeeded()
|
||||
// TODO: polyfill scrollintviewifneeded for other browsers besides chrome for scroll
|
||||
dom?.scrollIntoViewIfNeeded?.()
|
||||
|
||||
if (moveCursorToEnd) {
|
||||
viewRef.current?.dispatch({ selection: { anchor: content.length, head: content.length } })
|
||||
|
Loading…
Reference in New Issue
Block a user