@@ -8,7 +8,7 @@ import type {
8
8
StrippedLocation ,
9
9
} from "@/lib/enhancer"
10
10
import { logger } from "@/lib/logger"
11
- import { modifyDOM } from "../modifyDOM "
11
+ import { fixupOvertype , modifyDOM } from "../overtype-misc "
12
12
import { commonGitHubOptions , prepareGitHubHighlighter } from "./github-common"
13
13
14
14
const GH_PR_APPEND = "GH_PR_APPEND" as const
@@ -69,18 +69,14 @@ export class GitHubPrAppendEnhancer
69
69
) : OverTypeInstance {
70
70
prepareGitHubHighlighter ( )
71
71
const overtypeContainer = modifyDOM ( textArea )
72
- const overtype = new OverType ( overtypeContainer , {
73
- ...commonGitHubOptions ,
74
- minHeight : "102px" ,
75
- padding : "var(--base-size-8)" ,
76
- placeholder : "Add your comment here..." ,
77
- } ) [ 0 ] !
78
- const listenForEmpty = new MutationObserver ( ( ) => {
79
- if ( textArea . value === "" ) {
80
- overtype . updatePreview ( )
81
- }
82
- } )
83
- listenForEmpty . observe ( textArea , { attributes : true , characterData : true } )
72
+ const overtype = fixupOvertype (
73
+ new OverType ( overtypeContainer , {
74
+ ...commonGitHubOptions ,
75
+ minHeight : "102px" ,
76
+ padding : "var(--base-size-8)" ,
77
+ placeholder : "Add your comment here..." ,
78
+ } )
79
+ )
84
80
return overtype
85
81
}
86
82
0 commit comments