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

Custom Element's size attribute isn't rendered #12825

Closed
morewry opened this issue May 15, 2018 · 4 comments
Closed

Custom Element's size attribute isn't rendered #12825

morewry opened this issue May 15, 2018 · 4 comments

Comments

@morewry
Copy link

morewry commented May 15, 2018

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

Report a possible bug.

What is the current behavior?

Most of my custom element's attributes render, but the size attribute does not. It appears to be stripped out by React.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

I am testing a Web Component integration with React. Given a collection of possible attributes and values to test, I map through them and create multiple buttons,

[
...
  {
    href: 'https://google.com/',
    text: 'Link',
    id: 'c'
  },
  {
    size: 'jumbo',
    text: 'Jumbo',
    id: 'd'
  },
...
]
<dls-button key={id} href={href} label={label} size={size} theme={theme} type={type} width={width}>{text}</dls-button>

The href, label, theme, type, and width attributes are rendered when they have a value, as expected. However, the size attribute is missing.

What is the expected behavior?

The size attribute and its value should be rendered.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

react@16.3.2
Google Chrome 66.0.3359.139

All of this custom element's attributes function as expected when integrated with Angular or in a vanilla setup, but not with React.

@morewry
Copy link
Author

morewry commented May 15, 2018

Found this pre-existing issue and PR with a fix #12694 / #12702.

I'm not intimately familiar with React's release cycles--when is this likely to be in a release? Want to figure out if I should work around it in my code for the time being. If it will be published soon (as in, within a month or so) I can wait on it. Otherwise, I might need to work around the problem.

@gaearon
Copy link
Collaborator

gaearon commented May 16, 2018

Within a month, definitely.

@morewry
Copy link
Author

morewry commented May 16, 2018

Awesome, thanks very much!

@morewry morewry closed this as completed May 16, 2018
@gaearon
Copy link
Collaborator

gaearon commented May 24, 2018

Should be fixed in React 16.4.
https://reactjs.org/blog/2018/05/23/react-v-16-4.html

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

2 participants