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

target=_blank duplicates after clicking on it in the documentation example #8462

Closed
xinglie opened this issue Nov 15, 2020 · 2 comments · Fixed by #9693
Closed

target=_blank duplicates after clicking on it in the documentation example #8462

xinglie opened this issue Nov 15, 2020 · 2 comments · Fixed by #9693
Assignees
Labels
squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior. type:docs This issue reports a task related to documentation (e.g. an idea for a guide).

Comments

@xinglie
Copy link

xinglie commented Nov 15, 2020

📝 Provide detailed reproduction steps (if any)

use chrome visit "https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/conversion/conversion-preserving-custom-content.html#loading-content-with-a-custom-attribute" the live demo on mac.

click the demo links with target on right top .

gs

✔️ Expected result

show links popup and only one "target"

❌ Actual result

when click zone in "target" , editor duplicate "target" show

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@xinglie xinglie added the type:bug This issue reports a buggy (incorrect) behavior. label Nov 15, 2020
@Mgsy
Copy link
Member

Mgsy commented Nov 16, 2020

Hi, thanks for the report! I can confirm this issue, it has been introduced in v20.0.0.

@Mgsy Mgsy changed the title duplicate "target=_blank" target=_blank duplicates after clicking on it in the documentation example Nov 16, 2020
@Mgsy Mgsy added squad:core Issue to be handled by the Core team. type:docs This issue reports a task related to documentation (e.g. an idea for a guide). intro Good first ticket. labels Nov 16, 2020
@Mgsy Mgsy added this to the nice-to-have milestone Nov 16, 2020
@Mgsy Mgsy removed the intro Good first ticket. label Nov 16, 2020
@pomek
Copy link
Member

pomek commented Nov 16, 2020

Looks like the selection inherits some attributes from the URL after clicking at the end. It should not inherit anything (see: #1016).

Attributes of the text (URL) node:

image

Selection's attributes:

image

The code below should also remove attributes that can be added by automatic decorators:

function removeLinkAttributesFromSelection( writer, manualDecorators ) {
writer.removeSelectionAttribute( 'linkHref' );
for ( const decorator of manualDecorators ) {
writer.removeSelectionAttribute( decorator.id );
}
}

@pkwasnik pkwasnik self-assigned this Mar 9, 2021
@pomek pomek assigned pomek and unassigned pkwasnik May 13, 2021
@pomek pomek modified the milestones: nice-to-have, iteration 43 May 13, 2021
psmyrek added a commit that referenced this issue May 14, 2021
Fix (link): All text attributes starting their names with `link` will be removed when typing over a link or clicking at the end of the link. Closes #8462.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior. type:docs This issue reports a task related to documentation (e.g. an idea for a guide).
Projects
None yet
4 participants