mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 21:02:48 +08:00
FIX: Ensure tag topic lists are not scrolled to an incorrect position (#12805)
When navigating from a 'discovery' topic list to a 'tags' topic list, the scroll position from the 'discovery' list was being used by the tag list. That meant the user would be taken to a random point in the list, and not scrolled to the top. Non-tag topic lists were working fine because we only apply the 'cached' logic (and by extension, the saved scroll location) when the user clicks 'back' in the browser. In the code, this is referred to as `isPoppedState`. This commit takes the `isPoppedState` logic from the regular topic lists, and applies it to the tag topic lists.
This commit is contained in:
parent
984d87f30c
commit
890b06b10f
|
@ -95,7 +95,7 @@ export default DiscourseRoute.extend(FilterModeMixin, {
|
|||
}
|
||||
|
||||
return findTopicList(this.store, this.topicTrackingState, filter, params, {
|
||||
cached: true,
|
||||
cached: this.isPoppedState(transition),
|
||||
}).then((list) => {
|
||||
if (list.topic_list.tags && list.topic_list.tags.length === 1) {
|
||||
// Update name of tag (case might be different)
|
||||
|
|
Loading…
Reference in New Issue
Block a user