react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Allow `placeholder` to be a node

Open bradbirnbaum opened this issue 10 years ago • 3 comments

I would like to allow the placeholder to be a node so I can put an icon. If I have this method in my class renderPlaceholder() { return ( <span> <i className="icon mdi tag" /> Add tags... </span> ); }

and call it as a prop like placeholder={this.renderPlaceholder()}

it works well but I get a React Props warning. I think we should allow this so perhaps we can change the allowable props for placeholder to include node

bradbirnbaum avatar Nov 21 '16 02:11 bradbirnbaum

This seems like a 1-line PR waiting to happen?

wmertens avatar Mar 14 '17 15:03 wmertens

Any news on this one?

kstratis avatar Oct 31 '18 14:10 kstratis

This issue seemed to be for the v1 react-select.

v2 react-select allows to replace every internal component with a custom one via their Components Framework. An example for the Placeholder component an would be:

const Placeholder = (props) => { 
    return ( ... );
}; // or a class

<Select
    { ... }
    components={{ Placeholder }}
/>

Rall3n avatar Feb 20 '19 17:02 Rall3n