react-otp-input icon indicating copy to clipboard operation
react-otp-input copied to clipboard

how to remove inline width from input

Open preeti-droom opened this issue 5 years ago • 6 comments

  • Steps to reproduce the issue:

  • Relevant error messages and/or screenshots:

preeti-droom avatar Sep 30 '20 09:09 preeti-droom

@preeti-droom You may override it by using the inputStyle prop.

apollonian avatar Sep 30 '20 14:09 apollonian

But i don't want to override the width using '!important' in css, if any other solution then let me know

preeti-droom avatar Oct 01 '20 05:10 preeti-droom

how to apply styling to the individual default boxes after using OtpInput component?

yasasvy avatar Oct 20 '20 16:10 yasasvy

Hey, I have the same issue. In my case, I want to pass className from the Material UI styling solution (useStyles/makeStyles) to inputStyle props, but I can't override the width in my class, because the default one is always passed into style of the <input> elements and overrides mine. So either the style should not be applied when there is a className in inputStyle, or there should be a prop to turn the default style off, something like isDefaultInputStyleApplied: boolean with a true default.

rtrembecky avatar Jun 02 '21 14:06 rtrembecky

So either the style should not be applied when there is a className in inputStyle, or there should be a prop to turn the default style off, something like isDefaultInputStyleApplied: boolean with a true default.

@rtrembecky Considering something along similar lines for the next major release! Eliminating the limitations that inputStyle brings by doubling as a className prop is something to be addressed too. So, I'm thinking we could split it into inputStyle and inputClassName, where the inputStyle prop only takes a CSS style object and inputClassName applies class names to the input(s).

how to apply styling to the individual default boxes after using OtpInput component?

This would also allow us to accept a function and individually apply classnames to inputs.

apollonian avatar Jun 05 '21 05:06 apollonian

@apollonian is this change already in the release ? is it something that we could contribute ?

mdsadiq avatar Apr 15 '22 05:04 mdsadiq

You can now fully customize the input component with v3. Check the docs for more info

prateek3255 avatar Mar 25 '23 15:03 prateek3255

you can remove style property from renderInput function renderInput={({ style, ...props }) => <input {...props} />}

Supersmf avatar Aug 04 '23 09:08 Supersmf