Typeahead.js interferes with Bootstrap input groups

后端 未结 5 2035
无人共我
无人共我 2021-02-03 23:27

How do I keep Typeahead.js from splitting up my Twitter Bootstrap 3 input groups? Whenever I point the Typeahead javascript at a text area that\'s part of an input group, the jo

相关标签:
5条回答
  • 2021-02-04 00:12

    This project partially solved the issue for me: https://github.com/hyspace/typeahead.js-bootstrap3.less

    The only outstanding problem is when I apply shadow effect to both the .btn and .form-control the shadow is drawn also between the input field and the button.

    enter image description here

    0 讨论(0)
  • 2021-02-04 00:16

    Bootstrap v4 solution:

    .input-group > .twitter-typeahead {
       flex: 1 1 auto;
       width: auto;
    }
    
    0 讨论(0)
  • 2021-02-04 00:16

    This fixes the problem when the left-hand side of the text box is square (not rounded):

    .input-group .twitter-typeahead .form-control:not(:first-child):not(:last-child) {
      border-radius: 4px 0px 0px 4px;
    }
    
    0 讨论(0)
  • 2021-02-04 00:17
    .twitter-typeahead{ float:left; width:100%}
    
    0 讨论(0)
  • 2021-02-04 00:22

    maybe?

    .twitter-typeahead > .form-control{
      width: inherit !important;
    }
    
    0 讨论(0)
提交回复
热议问题