I have this contentEditable div and I need it to have a fixed size/capacity. The div should not keep making new lines if it reaches the capacity and the user shouldn't be able to keep typing in the div. Ex. if the height is 600px, and the user keeps spamming enter to make new lines at some point the user will press the enter button and a new line will not show up because they reached the capacity of the contentEditable div. An analogy would be Google Docs, when the user reaches the end of the page, a new page pops up below except for my purposes I don't need anything to happen after the user reaches the end of the contentEditable div.
This is my code so far there shouldn't be any need to have an overflow though since my div will have a fixed capacity,
<div
ref={contentEditableRef}
contentEditable
className="content-to-print"
style={{
padding: "20px",
color: changeToDarkMode === "true" ? "white" : "black",
backgroundColor: "none",
overflow: "hidden",
fontSize: "16px",
fontFamily: "Arial, sans-serif",
textAlign: "left",
top: "80px",
outline: "none",
height: "1020px",
border:'1px solid black',
}}
</div>