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

Sun Editor Link Plugin - Unchecked - Open in New Window Modal #1448

Open
svinayaka opened this issue Sep 13, 2024 · 0 comments
Open

Sun Editor Link Plugin - Unchecked - Open in New Window Modal #1448

svinayaka opened this issue Sep 13, 2024 · 0 comments

Comments

@svinayaka
Copy link

svinayaka commented Sep 13, 2024

I am using Sun Editor version 2.47.0 with the default “Link” plugin. When I add a link with the “Open in New Window” option unchecked and set the editor to read-only mode, the link (e.g., Google) still opens in a new window instead of the same window. This happens regardless of whether the “Open in New Window” option is checked or unchecked. Is this a bug, or am I missing a configuration?

What I observe is that in the _anchor.js file, the code is as follows:
if (contextAnchor.newWindowCheck.checked) anchor.target = '_blank'; else anchor.removeAttribute('target');
When I explicitly replace anchor.removeAttribute('target') with anchor.target = '_self', it works as expected. However, in version 2.47.0, the code else anchor.removeAttribute('target'); causes the link to open in a new tab regardless of whether the newWindowCheck option is unchecked.

Experimental link: https://jsfiddle.net/5p978er4/3/

@JiHong88

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

No branches or pull requests

1 participant