-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
use <span> on Event when no url is provided #6266
base: main
Are you sure you want to change the base?
use <span> on Event when no url is provided #6266
Conversation
06738e4
to
9cc0d06
Compare
Any update on this? I believe this has been open for a while now (the original issue was opened more than a year ago). |
Any updates on this? |
Just wanted to add that I think that it should be a |
@eloyesp |
Happy to rebase this if @arshaw gives a 👍 for the proposed change. |
I think this is still an issue. I don't think we're expecting block elements here so span is still the best inline candidate to be an anchor alternative. |
Bumping as this issue looks like it hasn't been commented on in a while. I would also love to see this update. Couple ideas for other possible solutions:
Edit: Reading more thoroughly through @brandonwestcott 's original comment its seems my first solution could easily be handled by adding a custom prop to the EventDef. Would love to see some way to customize this element type.
|
As described in #5710, current rendering produced invalid DOM when event render contains an
a
element. WhileonClick
handlers inside the event allow a valid DOM, it limits the ability to have the normal benefits of an anchor tag, including "Open Link in New Tab" and a11y compatibility.This implements a conditional check to see if
url
is set on theEventDef
, if present usea
, else usespan
.Now, one could argue
a
=>span
|a
could be considered a breaking change. If so, an alternative could be to add an additional attribute onto theEventDef
to control the wrapping element type.Resolves #5710