fix(dees-tile-note): use horizontal pointer position to scroll note body by computing percentage from clientX and element width instead of clientY and height
This commit is contained in:
@@ -213,8 +213,8 @@ export class DeesTileNote extends DeesTileBase {
|
||||
if (totalLines <= 12) return;
|
||||
|
||||
const rect = this.getBoundingClientRect();
|
||||
const y = e.clientY - rect.top;
|
||||
const percentage = Math.max(0, Math.min(1, y / rect.height));
|
||||
const x = e.clientX - rect.left;
|
||||
const percentage = Math.max(0, Math.min(1, x / rect.width));
|
||||
|
||||
const maxScroll = this.noteBodyElement.scrollHeight - this.noteBodyElement.clientHeight;
|
||||
this.noteBodyElement.scrollTop = percentage * maxScroll;
|
||||
|
||||
Reference in New Issue
Block a user