delete unused utils
This commit is contained in:
parent
cf65fa3b02
commit
f5cd140a7d
1 changed files with 0 additions and 19 deletions
|
|
@ -1,19 +0,0 @@
|
|||
export function scrollToComment(commentId) {
|
||||
const selector = `div[data-comment-id="${commentId}"]`;
|
||||
const commentElement = document.querySelector(selector);
|
||||
if (commentElement) {
|
||||
commentElement.scrollIntoView({ behavior: 'smooth' });
|
||||
}
|
||||
}
|
||||
|
||||
export const scrollToCommentInScrollArea = (commentId, scrollAreaRef) => {
|
||||
const commentElement = scrollAreaRef.current.querySelector(`[data-comment-id="${commentId}"]`);
|
||||
|
||||
if (commentElement) {
|
||||
const scrollArea = scrollAreaRef.current;
|
||||
const commentTop = commentElement.offsetTop;
|
||||
const scrollAreaTop = scrollArea.offsetTop;
|
||||
|
||||
scrollArea.scrollTop = commentTop - scrollAreaTop;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue