JedWatson / react-input-autosize

Auto-resizing input field for React
https://jedwatson.github.io/react-input-autosize
MIT License
769 stars 178 forks source link

How do you style the inner input? #169

Open RichMatthews opened 4 years ago

RichMatthews commented 4 years ago

I'm passing in my styles object like so:

    const styles = {
        border: '1px solid #ff5a5f',
        borderRadius: '5px',
        color: '#ff5a5f',
        padding: '7px',
        margin: '5px',
        textAlign: 'center',
        outline: 'none',
        cursor: 'default',
    }
<AutosizeInput value={ppl} onChange={(e) => onChange(e, index)} style={styles} />

but this just styles the outer wrapping div

how do I style the inner input?

ibraheemdev commented 4 years ago

I was wondering the same thing. There is no documentation on this, yet the example shows padding on the inner input.

ibraheemdev commented 4 years ago

Ah, I just took a look at the examples. Turns out you have to use the inputStyle or inputClassName props: <AutosizeInput inputStyle={styles} />