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.
This commit is contained in:
Alexander Skvortsov 2022-04-21 18:03:41 -04:00 committed by GitHub
parent 42602a099f
commit 4cb15501a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,7 +322,7 @@ export default class TagDiscussionModal extends Modal<TagDiscussionModalAttrs> {
m.redraw();
if (scrollToItem) {
if (scrollToItem && this.selectedTag) {
const dropdownScroll = $dropdown.scrollTop()!;
const dropdownTop = $dropdown.offset()!.top;
const dropdownBottom = dropdownTop + $dropdown.outerHeight()!;