diff --git a/app/assets/javascripts/discourse/components/edit-category-tab.js.es6 b/app/assets/javascripts/discourse/components/edit-category-tab.js.es6 index 556e072ea15..220da95a4ac 100644 --- a/app/assets/javascripts/discourse/components/edit-category-tab.js.es6 +++ b/app/assets/javascripts/discourse/components/edit-category-tab.js.es6 @@ -23,9 +23,17 @@ export default Em.Component.extend({ this.get('panels').addObject(this.get('tabClassName')); }, + _resetModalScrollState() { + const $modalBody = this.$().parents("#discourse-modal").find(".modal-body"); + if ($modalBody.length === 1) { + $modalBody.scrollTop(0); + } + }, + actions: { select: function() { this.set('selectedTab', this.get('tab')); + this._resetModalScrollState(); } } });