mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-02-04 01:32:54 +08:00
fix editor disappear on resize
This commit is contained in:
parent
615de0c157
commit
53ee0632d1
@ -63,7 +63,7 @@ const JsonEditor: React.FC<{
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const resizeObserver = new ResizeObserver((observed) => {
|
const resizeObserver = new ResizeObserver((observed) => {
|
||||||
const width = observed[0].contentRect.width;
|
const width = observed[0].contentRect.width;
|
||||||
setEditorWidth(width.toString());
|
setEditorWidth(width ? width.toString() : "auto");
|
||||||
});
|
});
|
||||||
|
|
||||||
const dom = document.querySelector(".ace_scroller");
|
const dom = document.querySelector(".ace_scroller");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user