fixing errors
This commit is contained in:
parent
2b3378f5df
commit
1410bef852
|
@ -209,11 +209,15 @@ export function ContractPageContent(
|
||||||
const [answerResponse, setAnswerResponse] = useState<Answer | undefined>(
|
const [answerResponse, setAnswerResponse] = useState<Answer | undefined>(
|
||||||
undefined
|
undefined
|
||||||
)
|
)
|
||||||
|
const answerRef = useRef<null | HTMLDivElement>(null)
|
||||||
const onAnswerCommentClick = useEvent((answer: Answer) => {
|
const onAnswerCommentClick = useEvent((answer: Answer) => {
|
||||||
setAnswerResponse(answer)
|
setAnswerResponse(answer)
|
||||||
|
if (answerRef.current) {
|
||||||
answerRef.current.scrollIntoView({ behavior: 'smooth' })
|
answerRef.current.scrollIntoView({ behavior: 'smooth' })
|
||||||
|
} else {
|
||||||
|
console.error('no ref to scroll to')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const answerRef = useRef(null)
|
|
||||||
const onCancelAnswerResponse = useEvent(() => setAnswerResponse(undefined))
|
const onCancelAnswerResponse = useEvent(() => setAnswerResponse(undefined))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user