diff --git a/src/addons/messages/pages/discussion/discussion.html b/src/addons/messages/pages/discussion/discussion.html index b3de76af9..2eb15f375 100644 --- a/src/addons/messages/pages/discussion/discussion.html +++ b/src/addons/messages/pages/discussion/discussion.html @@ -129,8 +129,8 @@ [attr.aria-label]="'addon.messages.newmessages' | translate"> {{ 'addon.messages.newmessages' | translate }} - {{ newMessages }} + {{ newMessages }} diff --git a/src/addons/messages/pages/discussion/discussion.page.ts b/src/addons/messages/pages/discussion/discussion.page.ts index febd175eb..d2823438f 100644 --- a/src/addons/messages/pages/discussion/discussion.page.ts +++ b/src/addons/messages/pages/discussion/discussion.page.ts @@ -1092,8 +1092,8 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView // Leave time for the view to be rendered. await CoreUtils.nextTicks(5); - if (!this.viewDestroyed) { - this.content!.scrollToBottom(0); + if (!this.viewDestroyed && this.content) { + this.content.scrollToBottom(0); } if (force) { @@ -1106,10 +1106,10 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView * Scroll to the first new unread message. */ scrollToFirstUnreadMessage(): void { - if (this.newMessages > 0) { + if (this.newMessages > 0 && this.content) { const messages = Array.from(this.hostElement.querySelectorAll('.addon-message-not-mine')); - CoreDomUtils.scrollToElement(this.content!, messages[messages.length - this.newMessages]); + CoreDomUtils.scrollToElement(this.content, messages[messages.length - this.newMessages]); } } diff --git a/src/addons/messages/pages/discussion/discussion.scss b/src/addons/messages/pages/discussion/discussion.scss index 57320a0c6..2db2276f0 100644 --- a/src/addons/messages/pages/discussion/discussion.scss +++ b/src/addons/messages/pages/discussion/discussion.scss @@ -19,19 +19,12 @@ padding-bottom: 0; } - ion-fab ion-fab-button { - &::part(native) { - contain: unset; - overflow: visible; - } - - .core-discussion-messages-badge { - position: absolute; - color: var(--addon-messages-discussion-badge-text); - background-color: var(--addon-messages-discussion-badge); - display: block; - @include position(-6px, -6px, null, null); - } + ion-fab .core-discussion-messages-badge { + position: absolute; + color: var(--addon-messages-discussion-badge-text); + background-color: var(--addon-messages-discussion-badge); + display: block; + @include position(0, 0, null, null); } ion-header ion-toolbar h1 {