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
No known key found for this signature in database
GPG Key ID: E055D6A4D513575C
1 changed files with
2 additions and
2 deletions
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 {
/ / s c r o l l t h e v i e w p o r t s l i g h t l y f u r t h e r t o m a k e s u r e t h e e l e m e n t i s a b o u t 1 / 3 f r o m t h e t o p
this . scroller . scrollTop += this . scroller . offsetHeight / 4
}
element . focus ( )
if ( highlightAnimation ) {
element . focus ( )
element . highlightAnimation ( )
}
} )