Proposal/clear link tool state#3000
Open
akulistus wants to merge 13 commits into
Open
Conversation
akulistus
requested review from
TatianaFomina,
gohabereg,
ilyamore88 and
neSpecc
as code owners
April 21, 2026 22:14
neSpecc
reviewed
Apr 22, 2026
Comment on lines
+417
to
+418
| * Checks if the current selection range starts outside | ||
| * of a popover item element |
Member
There was a problem hiding this comment.
Ideally, link tool should not know about Popover and its implementation. Explain, why it is needed.
| } | ||
|
|
||
| /** | ||
| * Calls instance clear function |
| onActivate: (item: PopoverItemParams, event?: PointerEvent) => void; | ||
|
|
||
| /** | ||
| * Popover item clear handler |
There was a problem hiding this comment.
Pull request overview
This PR addresses a regression in the Link inline tool where clicking the unlink action while the link popover/input is open could close the popover without actually removing the link. It also updates the release metadata to ship the fix.
Changes:
- Update
LinkInlineTool.surround()to unlink only on an explicit link-tool click (vs. programmatic close scenarios). - Add Cypress coverage for unlinking via toolbar item click and for popover/selection interactions.
- Bump patch version and add a changelog entry for the fix.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/components/inline-tools/inline-tool-link.ts |
Tracks explicit button clicks to distinguish unlink intent from programmatic popover closes. |
test/cypress/tests/inline-tools/link.cy.ts |
Adds E2E coverage for unlink behavior and popover behavior during selection/tool changes. |
package.json |
Bumps version to 2.31.7 for the patch release. |
docs/CHANGELOG.md |
Documents the unlink fix in 2.31.7. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
178
to
182
| const parentAnchor = this.selection.findParentTag('A'); | ||
| const buttonClicked = this.BUTTON_CLICKED; | ||
|
|
||
| this.BUTTON_CLICKED = false; | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue (#2979 (comment)) preventing text unlinking by clicking link popover item block in toolbar.