Skip to content

Commit

Permalink
codeWordWrap toggling can impact scroll => trigger update
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Apr 21, 2022
1 parent 4b19c7a commit 5a14be5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export function useCodeWordWrap(codeBlockRef: React.RefObject<HTMLPreElement>) {
setIsCodeScrollable(isScrollable);
}, [codeBlockRef]);

useEffect(() => {
updateCodeIsScrollable();
}, [isEnabled, updateCodeIsScrollable]);

useEffect(() => {
updateCodeIsScrollable();

Expand Down

0 comments on commit 5a14be5

Please sign in to comment.