mirror of
https://github.com/harness/drone.git
synced 2025-05-12 23:20:10 +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 {
|
interface MarkdownEditorWithPreviewProps {
|
||||||
className?: string,
|
className?: string
|
||||||
value?: string
|
value?: string
|
||||||
onChange?: (value: string) => void
|
onChange?: (value: string) => void
|
||||||
onSave?: (value: string) => void
|
onSave?: (value: string) => void
|
||||||
@ -311,8 +311,8 @@ function scrollToAndSetCursorToEnd(
|
|||||||
if (!dom) {
|
if (!dom) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// TODO: polyfill scrollintviewifneeded for other browsers besides chrome for scroll
|
||||||
dom.scrollIntoViewIfNeeded()
|
dom?.scrollIntoViewIfNeeded?.()
|
||||||
|
|
||||||
if (moveCursorToEnd) {
|
if (moveCursorToEnd) {
|
||||||
viewRef.current?.dispatch({ selection: { anchor: content.length, head: content.length } })
|
viewRef.current?.dispatch({ selection: { anchor: content.length, head: content.length } })
|
||||||
|
Loading…
Reference in New Issue
Block a user