You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Desktop: Fixed regression with Ace Editor (switching layout had bugs)
This commit is contained in:
@ -239,3 +239,16 @@ export function useScrollHandler(editor: any, webviewRef: any, onScroll: Functio
|
||||
|
||||
return { resetScroll, setEditorPercentScroll, setViewerPercentScroll, editor_scroll };
|
||||
}
|
||||
|
||||
export function useRootWidth(dependencies:any) {
|
||||
const { rootRef } = dependencies;
|
||||
|
||||
const [rootWidth, setRootWidth] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (!rootRef.current) return;
|
||||
setRootWidth(rootRef.current.offsetWidth);
|
||||
});
|
||||
|
||||
return rootWidth;
|
||||
}
|
||||
|
Reference in New Issue
Block a user