1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00

Desktop: Fixes #5694: Sync-scroll support for HTML notes (#5695)

This commit is contained in:
Kenichi Kobayashi 2021-11-12 02:28:32 +09:00 committed by GitHub
parent 4bfb4db5f1
commit ec8b9b8ea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ export class SyncScrollMapper {
}
// Since getBoundingClientRect() returns a relative position,
// the offset of the origin is needed to get its aboslute position.
const offset = doc.getElementById('rendered-md').getBoundingClientRect().top;
const offset = doc.getElementById('rendered-md')?.getBoundingClientRect().top;
if (!offset) return null;
// Mapping information between editor's lines and viewer's elements is
// embedded into elements by the renderer.