Giter VIP home page Giter VIP logo

Comments (11)

edwardfxiao avatar edwardfxiao commented on May 23, 2024

Can you provide an example that you wish to modify?

Normally you can achieve that by providing the following props

<Textbox
classNameInput="myCustomInputClass"
classNameWrapper="myCustomWrapperClass"
classNameContainer="myCustomContainerClass"
customStyleInput={{ paddingTop: '0', paddingBottom: '0', height: '50px', paddingLeft: '20px', paddingRight: '20px', border: 'none' }}
customStyleWrapper={{padding: '2px'}}
customStyleContainer={{padding: '3px'}}
/>

if you find something that cannot be done by those props, you can overwrite it directly from css.
e.g.

.myCustomWrapperClass input[type='text'].react-inputs-validation__textbox__input___20hDL{
  border-radius: 40px !important;
  border-color: transparent !important;
}

One more example

image

<div>
  <div>
    <Textbox
      tabIndex="1"
      id=""
      customStyleWrapper={{ height: '100%' }}
      customStyleContainer={{ height: '100%' }}
      customStyleInput={
        { 
          paddingTop: '0', 
          paddingBottom: '0', 
          height: '45px', 
          paddingLeft: '20px', 
          paddingRight: '0px', 
          border: 'none', 
          textAlign: 'right'
        }
      }
      value={name}
      type={`text`}
      placeholder="enter the name"
      onChange={this.handleNameChange}
      onBlur={() => {}}
      validationOption={{
        check: false
      }}
    />
  </div>
  <div className="border" />
  <div>
    <Textbox
      tabIndex="2"
      id=""
      customStyleWrapper={{ height: '100%' }}
      customStyleContainer={{ height: '100%' }}
      customStyleInput={
        { 
          paddingTop: '0', 
          paddingBottom: '0', 
          height: '45px', 
          paddingLeft: '20px', 
          paddingRight: '0px', 
          border: 'none', 
          textAlign: 'right'
        }
      }
      value={title}
      type={`text`}
      placeholder="enter the title"
      onChange={this.handleTitleChange}
      onBlur={() => {}}
      validationOption={{
        check: false
      }}
    />
  </div>
  <div className="border" />
</div>

from react-inputs-validation.

IrvingArmenta avatar IrvingArmenta commented on May 23, 2024

This is what I was looking for, thank you.

from react-inputs-validation.

MRMTC avatar MRMTC commented on May 23, 2024

Hi Guys :)

Firstly, thanks for the great library! Its really helped me to get some validations implemented on my forms. I was trying to update the width of the "Textbox" and "Select" components so that they don't stretch across the entire screen as seen below:

image

Can you please guide me on where the best place is to update the width/CSS so that for example the two elements can sit side by side?

Thanks.

from react-inputs-validation.

MRMTC avatar MRMTC commented on May 23, 2024

So I got the width of each element to scale down using the CSS elements seen below (including removing one of the borders), but I can't get them to be inline with one another? Do you guys have any suggestions with respect to that?

`.react-inputs-validation__textbox__wrapper___3tnXv{
width: 15em !important;
}

.react-inputs-validation__select__wrapper___1B4OH{
width: 15em !important;
}

.react-inputs-validation__msg___pxv8o .react-inputs-validation__error___2aXSp {
padding: 0% !important;
position: relative;
border: 0px solid #e5e5e5 !important;
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
}

.react-inputs-validation__select__container___3jgUR {
padding: 0% !important;
position: relative;
border: 0px solid #e5e5e5 !important;
/box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);/
}`

image

from react-inputs-validation.

edwardfxiao avatar edwardfxiao commented on May 23, 2024

why don't you wrap Components inside a div? So that you can manipulate the with of the Textbox by manipulating its parent

maybe something like this
https://codesandbox.io/s/mo6y614v88

from react-inputs-validation.

MRMTC avatar MRMTC commented on May 23, 2024

Thanks @edwardfhsiao :) I was actually looking at doing something like this with the bootstrap libraries as well - I got to the same point i.e. where the boxes were centered underneath one another. Your way is simpler though, so I have adopted that :)

Is there a way to put the "input" and "dropdown" boxes next to each other? Something like:
"Place your name here ^-^" "US ⌄"

Instead of the current:
"Place your name here ^-^"
"US ⌄"

It seems like there is a "break" between the two components that I can't get rid of?

from react-inputs-validation.

edwardfxiao avatar edwardfxiao commented on May 23, 2024

you want dropdown to be inside the input or just line up next to the input ?

from react-inputs-validation.

MRMTC avatar MRMTC commented on May 23, 2024

Hi @edwardfhsiao,

Apologies for the confusion on my end. I would like to get them to align to one another as in the "mock" view below that I edited from your code sandbox above:
image

from react-inputs-validation.

edwardfxiao avatar edwardfxiao commented on May 23, 2024

@MRMTC https://codesandbox.io/s/mo6y614v88, you can always play around those CSS

from react-inputs-validation.

MRMTC avatar MRMTC commented on May 23, 2024

Awesome stuff, thanks so much @edwardfhsiao :) I hope you have a great week ahead!

from react-inputs-validation.

edwardfxiao avatar edwardfxiao commented on May 23, 2024

@MRMTC my pleasure

from react-inputs-validation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.