mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +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(() => {
|
||||
const resizeObserver = new ResizeObserver((observed) => {
|
||||
const width = observed[0].contentRect.width;
|
||||
setEditorWidth(width.toString());
|
||||
setEditorWidth(width ? width.toString() : "auto");
|
||||
});
|
||||
|
||||
const dom = document.querySelector(".ace_scroller");
|
||||
|
Loading…
x
Reference in New Issue
Block a user