ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Enable button/form input appending

Open mlynch opened this issue 13 years ago • 3 comments

Like bootstrap.

mlynch avatar Nov 23 '13 15:11 mlynch

This work? http://ionicframework.com/docs/components/#item-input-inset

adamdbradley avatar Dec 06 '13 04:12 adamdbradley

This isn't really a match to the bootstrap scenario. It burns a lot of form real estate the way it is currently rendered. The look of the bootstrap element is much nicer, IMHO. Also, the add-on w/ a drop down is very nice as well. Anything that could be done to match the bootstrap element more closely?

jeffleus avatar Dec 11 '14 23:12 jeffleus

FWIW, I just added a sass file to my project with a set of .item-input-prepend/.item-input-append class declarations.

It looks thusly:


.item-input
  .item-input-prepend
    input
      padding-left: 100px
  .item-input-append, .item-input-prepend
    display: flex
    .item-prepend
      position:relative
      border-right: solid 1px darken($stable, 10%)
    .item-appended
      right: 0
    .item-appended, .item-prepend
      top: 0
      position: absolute
      padding-top: 12px
      text-align: center
      width: 50px
      font-weight: 500
      color: darken($stable, 30%)
      border-left: solid 1px darken($stable, 10%)
      min-height: 50px
      background-color: $stable

Usage is like so (please excuse my jade formatting, that's what this syntax is) :

        label.item.item-input
          span.input-label Value
          .item-input-prepend
            .item-prepend $
            input(
              name="taxrate",
              required,
              type='text',
              ng-pattern="patternRe",
              ng-model='tax.value',
              placeholder='8.75')
        label.item.item-input
          span.input-label Value
          .item-input-append
            input(
              name="taxrate",
              required,
              type='text',
              ng-pattern="patternRe",
              ng-model='tax.value',
              placeholder='8.75')
            .item-appended %

uxtx avatar Aug 27 '15 14:08 uxtx