Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

RadioItems does not put option.value into the labels key attribute #161

Open
ppwfx opened this issue Feb 17, 2018 · 1 comment
Open

RadioItems does not put option.value into the labels key attribute #161

ppwfx opened this issue Feb 17, 2018 · 1 comment

Comments

@ppwfx
Copy link

ppwfx commented Feb 17, 2018

dash-core-components==0.18.1

According to this, the label element should have a key attribute containing option.value

https://github.com/plotly/dash-core-components/blob/master/src/components/RadioItems.react.js#L42

This is how it's actually rendered for me in Chrome and FF:

<div id="radio_y">
   <label class="yo"> <!-- actual -->
      <input type="radio" class="" value="on">
         <!-- react-text: 7005 -->
         mean_fit_time
         <!-- /react-text -->
   </label>
</div>

That's what I`d have expected:

<div id="radio_y">
   <label class="yo" key="mean_fit_time"> <!-- expected -->
      <input type="radio" class="" value="on">
         <!-- react-text: 7005 -->
         mean_fit_time
         <!-- /react-text -->
   </label>
</div>

Do you have an idea what could cause that?

@utyf
Copy link

utyf commented Feb 26, 2018

It's related to React itself. In React <15.4.2 (which is used in Dash) all additional tags are cut.

In React 16 it's not:
https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html


JFYI: plotly/dash-renderer#45
PR to add React 16 support to dash-renderer

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

No branches or pull requests

2 participants