material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[SelectField] label bug

Open cezarsmpio opened this issue 10 years ago • 33 comments

My code:

<SelectField
  hintText="Select the bicycle"
  menuItems={[
    { payload: 0, text: 'Bike 01' },
    { payload: 1, text: 'Bike 02' },
    { payload: 2, text: 'Bike 03' },
    { payload: 3, text: 'Bike 04' },
  ]}
/>

SelectField bug

drxxxhbreb

cezarsmpio avatar Dec 09 '15 15:12 cezarsmpio

You beat me to it.. I'd like to add..that in my case changing the selection does NOT remove the hint text.

justjacksonn avatar Dec 09 '15 15:12 justjacksonn

What version are you using? It seems that the issue is not present in the master branch.

oliviertassinari avatar Dec 09 '15 17:12 oliviertassinari

"material-ui": "^0.13.4"

cezarsmpio avatar Dec 09 '15 18:12 cezarsmpio

Could you try the master branch? This might be fixed.

oliviertassinari avatar Dec 09 '15 18:12 oliviertassinari

Use "0.14.0-rc1"?

cezarsmpio avatar Dec 09 '15 18:12 cezarsmpio

I would say master, we have recently changed the implementation of the SelectField.

oliviertassinari avatar Dec 09 '15 18:12 oliviertassinari

Hi @oliviertassinari, I'm using 0.14.0-rc1 (npm version) and the problem wasn't fixed.

cezarsmpio avatar Dec 10 '15 10:12 cezarsmpio

@CezarLuiz0 Please wait for 0.14.0-rc2 and try again with that.

alitaheri avatar Dec 10 '15 11:12 alitaheri

See: https://github.com/callemall/material-ui/issues/1427#issuecomment-165249532 Make sure when onChange is set, value is also set. That might be related.

bendiy avatar Dec 17 '15 00:12 bendiy

@CezarLuiz0 Is this fixed with the 0.14.0-rc2 or rather, master?

alitaheri avatar Dec 22 '15 19:12 alitaheri

I have just tried the examples of @CezarLuiz0 with the master branch. It's working correctly.

<SelectField
  hintText="Select the bicycle"
  menuItems={[
    { payload: 0, text: 'Bike 01' },
    { payload: 1, text: 'Bike 02' },
    { payload: 2, text: 'Bike 03' },
    { payload: 3, text: 'Bike 04' },
  ]}
/>

oliviertassinari avatar Dec 23 '15 10:12 oliviertassinari

Using 0.14.0-rc2 with npm, It was not fixed. Same problem here.

captura de tela 2015-12-23 as 08 55 02

captura de tela 2015-12-23 as 08 56 44

I will try use the master.

cezarsmpio avatar Dec 23 '15 10:12 cezarsmpio

Using npm install material-ui --save, the npm installed the version 0.13.4, same issue here.

-- edited

Using rc2 Example

cezarsmpio avatar Dec 23 '15 11:12 cezarsmpio

@CezarLuiz0 Can you share the SelectField source code?

oliviertassinari avatar Dec 23 '15 11:12 oliviertassinari

Sure!

    <SelectField
      hintText="Selecionar a bike"
      menuItems={[
        { payload: 0, text: 'Bike 01' },
        { payload: 1, text: 'Bike 02' },
        { payload: 2, text: 'Bike 03' },
        { payload: 3, text: 'Bike 04' },
      ]}
      fullWidth
    />

cezarsmpio avatar Dec 23 '15 11:12 cezarsmpio

Thanks, here is what I have: dec 23 2015 12 18

How to you reflect the change of what the user is selecting?

oliviertassinari avatar Dec 23 '15 11:12 oliviertassinari

See my gif above, the selected item by the user changed, but for you, SelectField doesn't changed. My main problem is the label on the item and when I select an item, It doesn't get the selected color.

In documentation, SelectField works fine :confused:

cezarsmpio avatar Dec 23 '15 11:12 cezarsmpio

I'm using the same source code than you. The result is completly different. I don't understand, that must be on your side. Make sure your material-ui is currently installed.

oliviertassinari avatar Dec 23 '15 11:12 oliviertassinari

Look my dependencies:

"dependencies": {
    "alt": "^0.18.0",
    "classnames": "^2.2.1",
    "flexboxgrid": "^6.3.0",
    "history": "^1.13.1",
    "lodash": "^3.10.1",
    "material-ui": "^0.14.0-rc2",
    "normalize.css": "^3.0.3",
    "react": "^0.14.0",
    "react-addons-css-transition-group": "^0.14.3",
    "react-addons-test-utils": "^0.14.0",
    "react-dom": "^0.14.0",
    "react-notification-system": "^0.2.6",
    "react-router": "^1.0.2",
    "react-tap-event-plugin": "^0.2.1",
    "react-toolbox": "^0.13.4",
    "rest-mapper": "^1.2.2"
  }

cezarsmpio avatar Dec 23 '15 11:12 cezarsmpio

Let's see what we have with 0.14.0-rc2: dec 23 2015 13 00 So you were right :+1:.

Still, this is what we have on the master branch: dec 23 2015 13 04 Looks like the issue was solved :smile: .

oliviertassinari avatar Dec 23 '15 12:12 oliviertassinari