Skip to content

Conversation

@akulistus
Copy link
Contributor

@akulistus akulistus commented Jan 18, 2026

Problem:
Applying the link tool on top of other formatting may also remove other tools tags.

Issue:
#2890

Solution:
Refactor removeFakeBackground function so it would no longer remove text formatting.

@akulistus
Copy link
Contributor Author

akulistus commented Jan 18, 2026

Don’t check the commits yet — I want to discuss the solution for the second part of the issue.

I discovered that the odd behavior is caused by this line:

this.nestedPopoverTriggerItem?.handleClick();

When, for example, the bold tool is applied, the inline toolbar rerenders, this line executes, and the unlink method is called. That’s why the link formatting disappears.

Should we remove this line?

Additionally, I noticed that the inline toolbar constantly rerenders when the link element is selected. For some reason, this is caused by this line:

this.nodes.input.value = hrefAttr !== 'null' ? hrefAttr : '';
I haven’t figured out exactly why, but changing from value to defaultValue resolves the issue.

@neSpecc
Copy link
Member

neSpecc commented Jan 19, 2026

this.nestedPopoverTriggerItem?.handleClick();

I don't think you should simply remove this line. Firstly, find out what this line is supposed to do. I don't remember it at the moment.

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.

3 participants