diff options
author | crupest <crupest@outlook.com> | 2020-06-16 17:05:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-16 17:05:37 +0800 |
commit | c949e3d9f40b32125a844e3c172aa62284510440 (patch) | |
tree | c7dfadc3d203490f042be1abefdce337a4416c8f /Timeline/ClientApp/src/app/timeline/TimelinePostEdit.tsx | |
parent | 5e70723e0e92e430575625d4af99e781934af395 (diff) | |
download | timeline-c949e3d9f40b32125a844e3c172aa62284510440.tar.gz timeline-c949e3d9f40b32125a844e3c172aa62284510440.tar.bz2 timeline-c949e3d9f40b32125a844e3c172aa62284510440.zip |
fix(front): Truly fix the layout bug when last post is short.
Diffstat (limited to 'Timeline/ClientApp/src/app/timeline/TimelinePostEdit.tsx')
-rw-r--r-- | Timeline/ClientApp/src/app/timeline/TimelinePostEdit.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/timeline/TimelinePostEdit.tsx b/Timeline/ClientApp/src/app/timeline/TimelinePostEdit.tsx index 6501e349..d1c09036 100644 --- a/Timeline/ClientApp/src/app/timeline/TimelinePostEdit.tsx +++ b/Timeline/ClientApp/src/app/timeline/TimelinePostEdit.tsx @@ -110,6 +110,12 @@ const TimelinePostEdit: React.FC<TimelinePostEditProps> = (props) => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const containerRef = React.useRef<HTMLDivElement>(null!); + const notifyHeightChange = (): void => { + if (props.onHeightChange) { + props.onHeightChange(containerRef.current.clientHeight); + } + }; + React.useEffect(() => { if (props.onHeightChange) { props.onHeightChange(containerRef.current.clientHeight); @@ -204,6 +210,7 @@ const TimelinePostEdit: React.FC<TimelinePostEditProps> = (props) => { <> <div className="d-block text-center mt-1 mb-2"> <Svg + onLoad={notifyHeightChange} src={kind === 'text' ? imageIcon : textIcon} className="icon-button" onClick={toggleKind} |