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

Change window.open target #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

dimitrov-d
Copy link
Contributor

Changed the target property of the window.open function from _blank to _self.
This is used in the context of actions of type external-link, which are supposed to open a new tab when the action button is clicked.

With the current behaviour, for different browsers and browser configurations it might open a new browser window instead of a new tab. I assume this is not the intended behaviour, since the confirm popup which gets shown says that the link will open in a new tab of the browser. The _self target value ensures that the current browsing context is always used.

target property reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target

@tsmbl
Copy link
Contributor

tsmbl commented Oct 11, 2024

Hey @dimitrov-d,

I believe the current behavior is correct. For external links, using target="_blank" is generally considered best practice. It aligns with user expectations and provides a better experience overall. Although target="_blank" may sometimes open a new window depending on the user's browser configuration, it is still the expected behavior

@dimitrov-d
Copy link
Contributor Author

Hey @dimitrov-d,

I believe the current behavior is correct. For external links, using target="_blank" is generally considered best practice. It aligns with user expectations and provides a better experience overall. Although target="_blank" may sometimes open a new window depending on the user's browser configuration, it is still the expected behavior

Thanks for your reply Alex. My idea was that setting the default behaviour to always open a new tab on the browser using target="_self" would align better with the warning message which contains the text "the link will open in a new tab of your browser".
I understand that setting the target to _blank is considered best practice, so if that is the expected behaviour we can close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants