Closed korshavn closed 5 years ago
I will be using "selectrix" instead. Great work! :-)
Feature request took into account :) I will check why I decided to ignore the placeholder and if it is possible I will add it. I will keep you posted 📬
The placeholder was initially ignored as it can be overlapped by the label. Starting with version 1.2.1 you can use a placeholder as long as there is no label defined. To set the placeholder:
<SingleSelect
style={{width: "85%"}}
placeholder="--- your placeholder here ---"
value={field.input.value}
options={field.options}
onChange={field.input.onChange}
/>
As you can see, you set it directly in the props of SingleSelect and not in SelectProps.placeholder Please check if it works as expected or it needs more improvements. Thanks.
Thank you! It works. :-)
I am happy that you are happy :smiley:
Hi. Would love if the select component could display a grey placeholder text..
In the picture above, the first input is a traditional Select (react-select). The second is with your library, and would prefer it. The others are just a free text and two date inputs.
I can see you have written "ignoring placeholder in SelectProps" in the doc. Is there a reason why?
Using together with redux-form:
` const renderReactSelectMaterialUIInput = (field) => { console.log("renderReactSelectMaterialUIInput", field); return <SingleSelect style={{width: "85%"}} SelectProps={{ placeholder:
}}
placeholder={ }
value={field.input.value}
options={field.options}
onChange={field.input.onChange}
/>
};
`
Best regards, Leif John K.