showStatusUpdateSuccessModal: boolean;
}
+const SCROLL_TO_COMMENT_BOTTOM_OFFSET = 300;
+
export default class HotspotViewer extends React.PureComponent<Props, State> {
mounted = false;
state: State;
if (prevProps.hotspotKey !== this.props.hotspotKey) {
this.fetchHotspot();
}
- if (this.commentTextRef.current) {
- this.commentTextRef.current.focus({ preventScroll: true });
- }
}
componentWillUnmount() {
if (this.commentTextRef.current) {
this.commentTextRef.current.focus({ preventScroll: true });
scrollToElement(this.commentTextRef.current, {
- bottomOffset: 100
+ bottomOffset: SCROLL_TO_COMMENT_BOTTOM_OFFSET
});
}
};