Skip to content

fix(selection): resolve parent tags from element boundaries - #3083

Open
Anurag-S1ngh wants to merge 1 commit into
codex-team:nextfrom
Anurag-S1ngh:fix/1408-firefox-link-selection
Open

Anurag-S1ngh wants to merge 1 commit into
codex-team:nextfrom
Anurag-S1ngh:fix/1408-firefox-link-selection

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown
Contributor

Summary

When a selection boundary points to an element with an offset instead of a text node, findParentTag started from the element itself and walked upward. Tags inside that element were never checked, so inline tools like Link could stay inactive after selecting linked text. Firefox can produce this boundary shape when double-clicking a word.

Selection boundaries that are elements are now resolved to the child node at the boundary offset before searching for the parent tag.

Changes

  • Add a boundary normalizer that descends into element boundaries using the selection offset.
  • Use normalized boundaries in findParentTag.
  • Add a Cypress test that selects the whole anchor element through element boundaries and expects findParentTag('A') to return it.

Testing

  • yarn lint
  • yarn test:e2e (390 passing)

Closes #1408

@Anurag-S1ngh
Anurag-S1ngh requested a review from neSpecc as a code owner December 3, 2026 11:37

This branch has not been deployed

No deployments
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.

[Bug] Firefox: Problems with inline tools when double clicking to select word.

1 participant