Fix spolier click not working on some browser

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-12-25 12:26:20 +05:30
parent d6b5f92d6c
commit 7c368ae029

View file

@ -82,7 +82,7 @@ function handleOnClickCapture(e) {
openProfileViewer(userId, roomId);
}
const spoiler = nativeEvent.path.find((el) => el?.hasAttribute?.('data-mx-spoiler'));
const spoiler = nativeEvent.composedPath().find((el) => el?.hasAttribute?.('data-mx-spoiler'));
if (spoiler) {
spoiler.classList.toggle('data-mx-spoiler--visible');
}