diff --git a/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js b/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js index 5478171da5..8d993ffbf3 100644 --- a/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js +++ b/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js @@ -257,7 +257,7 @@ ve.ui.MWCategoriesPage.prototype.setup = function ( metaList ) { this.categoryWidget.addItems( this.getCategoryItems() ); this.defaultSortInput.setValue( - defaultSortKeyItem ? defaultSortKeyItem.getAttribute( 'content' ) : '' + defaultSortKeyItem ? defaultSortKeyItem.getAttribute( 'content' ) : this.fallbackDefaultSortKey ); this.defaultSortKeyTouched = false; @@ -290,7 +290,7 @@ ve.ui.MWCategoriesPage.prototype.teardown = function ( data ) { if ( data && data.action === 'apply' ) { // Alter the default sort key iff it's been touched & is actually different if ( this.defaultSortKeyTouched ) { - if ( newDefaultSortKey === '' ) { + if ( newDefaultSortKey === '' || newDefaultSortKey === this.fallbackDefaultSortKey ) { if ( currentDefaultSortKeyItem ) { currentDefaultSortKeyItem.remove(); } diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js index 41a01e319b..98276c79c1 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js @@ -27,6 +27,7 @@ ve.ui.MWCategoryPopupWidget = function VeUiMWCategoryPopupWidget( config ) { this.removed = false; this.$title = $( '