1
0
mirror of https://github.com/flarum/core.git synced 2025-07-14 13:26:23 +02:00

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

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()!;