Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve getDOMInsertPointRect #2705

Merged
merged 4 commits into from
Jun 17, 2024
Merged

Conversation

JiuqingSong
Copy link
Collaborator

In order to get rect of the cursor, we have a function getDOMInsertPointRect(), it uses several different ways to get current rect.

However, one of them is to insert a temp SPAN then call getBoundingClientRect() of this SPAN. This causes a DOM tree change and can causes our content model cache to be cleared.

This change is to remove this way, and use a normalized range instead. It shows that for a range inside text node, it can return the rect successfully.

@JiuqingSong JiuqingSong merged commit 5c39847 into master Jun 17, 2024
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/getdominsertpointrect branch June 17, 2024 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants