Material-ui: [Select] Bug w/ label and multiple select field

Created on 3 Jan 2018  路  14Comments  路  Source: mui-org/material-ui

Fresh problem with last beta 26 in Select component. See steps for reproduce.

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

On blur event the label MUST be moved above the field.

Current Behavior

On blur event the label return back to select field and mixed w/ selected items context

onFocus
image

onBlur
image

Absolutely the same problem on your demo site https://material-ui-next.com/demos/selects/#multiple-select

Steps to Reproduce (for bugs)

  1. Going to https://material-ui-next.com/demos/selects/#multiple-select
  2. Select some items in multiple select example
  3. Click on any space on page
  4. See how label mixed with selected variants on field

image

Context

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI |1.0.0-beta.26|
| React |15.6.2|
| browser |Chrome 63.0.3239.84 for Mac|

bug 馃悰 Select

All 14 comments

Fixed in #9570

@oliviertassinari thanks a lot. Can you say when this fix will be released ?

You can rollback or wait for the next release next week.

Why is this closed? I'm using beta 33 and the problem still exists.

I'm using beta 38, it still bug

@usman-coe Do you have a reproduction example?

In my case, this bug occurs when I set the default value of select with null
example https://codesandbox.io/s/x7my6joroq
But when I change the default value of select to '' this bug is gone
example https://codesandbox.io/s/zrz32o01o3

@usman-coe Thanks for the feedback. The behavior you are describing is the expected behavior. You need to control the component. You might have missed the warning in the console:
capture d ecran 2018-03-30 a 15 56 08

I have worked on #10860 so the component fails fast:
capture d ecran 2018-03-30 a 15 58 28

I'm still experiencing this issue. It only happens the first time the select appears on the page. And I mean the very first. If I close the window or restart the server it doesn't do it anymore. And I don't know how to recreate the issue after that.

@Alebron23 If you can manage to create a minimal reproduction example, we would be happy to have a lookt at it.

I think I fixed it. I was using a selector with reselect for my redux store that was passing in undefined to the value prop on the Select component and it was complaining about switching from a controlled to uncontrolled component. Once I changed it to pass in an empty string instead it stopped doing it.

@oliviertassinari But thanks for the quick reply.

@Alebron23 Fixing this React warning ("from a controlled to uncontrolled component") can only help :).

In my case, this bug occurs when I set the default value of select with null
example https://codesandbox.io/s/x7my6joroq
But when I change the default value of select to '' this bug is gone
example https://codesandbox.io/s/zrz32o01o3

Same problem ! Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zabojad picture zabojad  路  3Comments

rbozan picture rbozan  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

ghost picture ghost  路  3Comments

reflog picture reflog  路  3Comments