Browse Source

Set focus to message only when anchor is set

Don't set focus on message element when scrolling to the first unread
message as this conflicts with focusInput() from the message form.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
pull/5823/head
Vincent Petry 5 years ago
parent
commit
cd04492df6
No known key found for this signature in database GPG Key ID: E055D6A4D513575C
  1. 4
      src/components/MessagesList/MessagesList.vue

4
src/components/MessagesList/MessagesList.vue

@ -779,7 +779,7 @@ export default {
*
* @param {string} messageId message id
* @param {boolean} smooth true to smooth scroll, false to jump directly
* @param {boolean} highlightAnimation true to highlight the focussed message
* @param {boolean} highlightAnimation true to highlight and set focus to the message
* @returns {bool} true if element was found, false otherwise
*/
focusMessage(messageId, smooth = true, highlightAnimation = true) {
@ -801,8 +801,8 @@ export default {
// scroll the viewport slightly further to make sure the element is about 1/3 from the top
this.scroller.scrollTop += this.scroller.offsetHeight / 4
}
element.focus()
if (highlightAnimation) {
element.focus()
element.highlightAnimation()
}
})

Loading…
Cancel
Save