Make sure the text box starts out in sync.
This commit is contained in:
parent
d5020d3f24
commit
c2850fa879
@ -1,4 +1,4 @@
|
||||
import React, { ReactNode, useMemo, useRef, useState } from "react";
|
||||
import React, { ReactNode, useEffect, useMemo, useRef, useState } from "react";
|
||||
import "./Editor.css";
|
||||
import { Highlight } from "./highlight";
|
||||
import { buildShadow } from "./shadow";
|
||||
@ -72,6 +72,11 @@ function Editor({ defaultValue = default_org_source }) {
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
// Make sure the text area and shadow div start out in sync.
|
||||
onTextAreaScroll();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="Editor">
|
||||
<div className="Editor-textwrapper">
|
||||
|
Loading…
Reference in New Issue
Block a user