From 4cb15501a253aedc841f68852319edbf3943b48e Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com> Date: Thu, 21 Apr 2022 18:03:41 -0400 Subject: [PATCH] fix(tags): TagDiscussionModal don't go to null tag (#3404) If the tag we are trying to select/highlight is undefined, we should not run the scroll animation. --- extensions/tags/js/src/forum/components/TagDiscussionModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx b/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx index 814522e8e..ca3b5f680 100644 --- a/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx +++ b/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx @@ -322,7 +322,7 @@ export default class TagDiscussionModal extends Modal { m.redraw(); - if (scrollToItem) { + if (scrollToItem && this.selectedTag) { const dropdownScroll = $dropdown.scrollTop()!; const dropdownTop = $dropdown.offset()!.top; const dropdownBottom = dropdownTop + $dropdown.outerHeight()!;