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

Issue with tabIndex on SVG elements #1061

Closed
jasongerbes opened this issue Apr 11, 2018 · 3 comments
Closed

Issue with tabIndex on SVG elements #1061

jasongerbes opened this issue Apr 11, 2018 · 3 comments

Comments

@jasongerbes
Copy link

Do you want to request a feature or report a bug?
Report a bug

What is the current behaviour?
As per React Issue #10987, setting a tabIndex on elements renders as tabIndex instead of tabindex, causing issues.

If the current behaviour is a bug, please provide the steps to reproduce.
<svg tabIndex={0}> renders incorrectly to <svg tabIndex="0">

What is the expected behaviour?
The tabIndex attribute should render as tabindex="0"

@Kanaye
Copy link

Kanaye commented Apr 12, 2018

Because of size constraints, preact doesn't maintain a list of property mappings.
Maybe this could be handled within preact-compat for compatibility reasons.
But imho a developer should just use tabindex if that 's the attribute he wants to set/change.

@developit
Copy link
Member

developit commented Apr 18, 2018

I'm in agreement with @Kanaye here - the correct name is already defined in the SVG spec, we don't need libraries like React or Preact to take liberties renaming things.

Side note: I also think this goes beyond filesize constraints to a more fundamental issue: changing behavior to deviate from an existing specification causes confusion and adds dangerous platform lock-in.
To see how that plays out, look at developer knowledge of onchange vs oninput over the past 5 years - these standardized events with well-defined behaviors are now misunderstood because React decided to create an entirely new semantic for onchange :(

@JoviDeCroock
Copy link
Member

This has been documented in preactjs/preact-www#615

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

No branches or pull requests

4 participants