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
<sl-button href target>
ignores target
when opening a new tab/window.
#1200
Comments
Glad you are looking into this. I hope you can reproduce it easily. Let me know. |
No problem. I'm trying to see if this is a Shoelace issue or a browser bug. The underlying anchor is rendered correctly, so I suspect it may be the latter or something related to the target id being referenced in a different document (shadow root rather than the main document). Usually, browser bugs are only replicable in one browser. I'm seeing the same behavior in Chrome, Safari, and Firefox, so this may be per spec. Still looking into it. |
It seems to work fine in this example. |
Indeed, Chrome was showing a click event handler |
Looks like this happens because of I don't think we want to stop doing this by default, as it's likely protecting a lot of people from exploits. Perhaps we should add |
Great find! Extended sl.rt.ht/1200/? with a light-DOM |
<sl-button href target>
ignores target
on first click.<sl-button href target>
ignores target
when opening a new tab/window.
Fixed in 1bc2a6e. The <sl-button href="https://example.com/" target="_blank">
rel = noreferrer noopener
</sl-button>
<sl-button href="https://example.com/" target="_blank" rel="">
rel = (empty)
</sl-button>
<sl-button href="https://example.com/" target="_blank" rel="test">
rel = test
</sl-button> |
Describe the bug
<sl-button href target>
ignorestarget
on first click.To Reproduce
Steps to reproduce the behavior:
N
timesN
tabs open ❌vs
N
times1
tab open ✔️Demo
See above.
Screenshots
N/A.
Browser / OS
Additional information
<sl-button href target>
cannot initiate a new tab with a newtarget
set.Once you open a tab with
target
properly defined,<sl-button href target>
does manage to target it just fine.The text was updated successfully, but these errors were encountered: