HomePhabricator
Diffusion Comm b5e057733351

[lib] Added getTextsOffsets function. Refactored mention-utils.js.

Description

[lib] Added getTextsOffsets function. Refactored mention-utils.js.

Summary:
I've done changes to mention/@-ing Regex.
Also added getTextsOffsets function. It is kinda hacky, but I couldn't find better way to do it.
It is used to measure cursor offset in pixels from textarea top-left corner, so we can position
@ing typeahead overlay correctly.
Currently it doesn't take into account that overlay may not fit into window, so it can overflow into the left side of window, but it will be fixed in next diffs.
I wanted to put it up, as I'm not at work on Mon/Tue, but may already get some review.

Test Plan:
Tested in next diffs.
Works correctly and displays overlay above currently typed "mention".

Reviewers: tomek, kamil, atul, ashoat

Reviewed By: tomek, ashoat

Subscribers: ashoat, atul, kamil, tomek

Differential Revision: https://phab.comm.dev/D5674

Details

Provenance
przemekAuthored on Nov 18 2022, 7:34 AM
Reviewer
tomek
Differential Revision
D5674: [lib] Added getTextsOffsets function. Refactored mention-utils.js.
Parents
rCOMMce8e2d9ef6a1: [services][blob] Handle removing blobs
Branches
Unknown
Tags
Unknown