mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-26 03:05:41 +03:00
Possible fix for weird truncation bug
This commit is contained in:
parent
bc4dfaf62f
commit
16c52ad3ea
1 changed files with 16 additions and 8 deletions
|
@ -211,10 +211,14 @@ function Status({
|
||||||
onResize: () => {
|
onResize: () => {
|
||||||
if (spoilerContentRef.current) {
|
if (spoilerContentRef.current) {
|
||||||
const { scrollHeight, clientHeight } = spoilerContentRef.current;
|
const { scrollHeight, clientHeight } = spoilerContentRef.current;
|
||||||
spoilerContentRef.current.classList.toggle(
|
if (scrollHeight < window.innerHeight * 0.4) {
|
||||||
'truncated',
|
spoilerContentRef.current.classList.remove('truncated');
|
||||||
scrollHeight > clientHeight,
|
} else {
|
||||||
);
|
spoilerContentRef.current.classList.toggle(
|
||||||
|
'truncated',
|
||||||
|
scrollHeight > clientHeight,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -224,10 +228,14 @@ function Status({
|
||||||
onResize: () => {
|
onResize: () => {
|
||||||
if (contentRef.current) {
|
if (contentRef.current) {
|
||||||
const { scrollHeight, clientHeight } = contentRef.current;
|
const { scrollHeight, clientHeight } = contentRef.current;
|
||||||
contentRef.current.classList.toggle(
|
if (scrollHeight < window.innerHeight * 0.4) {
|
||||||
'truncated',
|
contentRef.current.classList.remove('truncated');
|
||||||
scrollHeight > clientHeight,
|
} else {
|
||||||
);
|
contentRef.current.classList.toggle(
|
||||||
|
'truncated',
|
||||||
|
scrollHeight > clientHeight,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue