Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styles break when I use input group #1

Open
andrewtsar0w opened this issue Mar 22, 2016 · 7 comments
Open

Styles break when I use input group #1

andrewtsar0w opened this issue Mar 22, 2016 · 7 comments

Comments

@andrewtsar0w
Copy link

It worked in https://github.com/bassjobsen/typeahead.js-bootstrap-css for Bootstrap 3.

<div class="input-group input-group-lg">
    <span class="input-group-btn">
      <button class="btn btn-primary" type="button"><i class="fa fa-location-arrow"></i></button>
    </span>
    <input id="typeahead" type="text" class="form-control">
</div>
@andrewtsar0w andrewtsar0w changed the title Do not restore style when used with input group Do not restore style when using with input group Mar 22, 2016
@andrewtsar0w andrewtsar0w changed the title Do not restore style when using with input group Styles break when I use input group Mar 22, 2016
@bassjobsen
Copy link
Owner

@kleverigheid thank for posting your image.

First of all you should change your HTML according Bootstrap 4 new classes. Your HTML should like like that shown beneath:

<div class="input-group input-group-lg">
  <span class="input-group-addon" id="sizing-addon1">@</span>
  <input type="text" class="typeahead form-control">
</div>

But after that, i agree with you that the styles of the input are broken. The result will look like that shown in the picture below:

screenshot from 2016-03-23 15 59 57

I will fix the issue described above asap.

@jonchay
Copy link

jonchay commented Aug 8, 2016

Hi there, I'm not sure if that's the right fix. There are input-group-addon and input-group-btn, which both are supported in Bootstrap 4. Do you have a recommended fix for input-group-btn?

@rdeputat
Copy link

Is any updates?

@yaldabaoth444
Copy link

yaldabaoth444 commented Jun 8, 2018

try for input-group-append

.input-group>.twitter-typeahead {
     position: relative;
     -ms-flex: 1 1 auto;
     -webkit-box-flex: 1;
     flex: 1 1 auto;
     width: 1%;
     margin-bottom: 0;
 }
 .input-group>.twitter-typeahead:not(:last-child) {
     border-top-right-radius: 0;
     border-bottom-right-radius: 0;
 }
 .input-group>.twitter-typeahead>.tt-input {
     border-top-right-radius: 0;
     border-bottom-right-radius: 0;
 }
 .form-control.tt-input:focus {
     z-index: 3
 }

@M-A-R-K-13
Copy link

Will yaldabaoth444’s excellent contribution be added to the project?

@adslwy
Copy link

adslwy commented Nov 4, 2019

try for input-group-append

.input-group>.twitter-typeahead {
     position: relative;
     -ms-flex: 1 1 auto;
     -webkit-box-flex: 1;
     flex: 1 1 auto;
     width: 1%;
     margin-bottom: 0;
 }
 .input-group>.twitter-typeahead:not(:last-child) {
     border-top-right-radius: 0;
     border-bottom-right-radius: 0;
 }
 .input-group>.twitter-typeahead>.tt-input {
     border-top-right-radius: 0;
     border-bottom-right-radius: 0;
 }
 .form-control.tt-input:focus {
     z-index: 3
 }

this code saved my life, thank you yaldabaoth444

@yaldabaoth444
Copy link

I am glad to help

tcoldmf added a commit to tcoldmf/typeahead.js-bootstrap4-css that referenced this issue Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants