mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
fix(MessagesList): ensure parent exists
- fix "Cannot read properties of null (reading 'parentElement')" Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
46818f57b6
commit
f98ce145bb
1 changed files with 2 additions and 1 deletions
|
|
@ -928,7 +928,8 @@ export default {
|
|||
let scrollElement = element
|
||||
if (this.isChatVisible && scrollElement.offsetParent === null) {
|
||||
console.debug('Message to focus is hidden, scrolling to its nearest visible parent', messageId)
|
||||
scrollElement = scrollElement.closest('ul[style="display: none;"]').parentElement
|
||||
const closestParent = scrollElement.closest('ul[style="display: none;"]') ?? scrollElement.closest('ul')
|
||||
scrollElement = closestParent.parentElement
|
||||
}
|
||||
|
||||
console.debug('Scrolling to a focused message programmatically')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue