Shared: CampaignsBanner: UseFitText: fix
The text didn't minimize when closing previous banner
This commit is contained in:
parent
c7910717d4
commit
8887dc9303
@ -43,7 +43,8 @@ const useFitText = (
|
||||
!!ref.current && ref.current.scrollHeight > ref.current.offsetHeight;
|
||||
|
||||
if (isOverflow) {
|
||||
setFontSize((prevFontSize) => prevFontSize - 1);
|
||||
const newFontSize = fontSize - 1;
|
||||
setFontSize(newFontSize);
|
||||
}
|
||||
}, [currentFontSize, fontSize, ref?.current?.scrollHeight]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user