question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bootstrap input-group problem

See original GitHub issue

I am using EasyAutocomplate with Bootstrap and if I use an input box without any class or format it works but when I put the input in a div with input-group class (from Bootsrap) EasyAutocomplate does not show first item from Ajax request.

I tried adjectWith as suggested here https://github.com/pawelczak/EasyAutocomplete/issues/154 But it did not work for me.

Here is html

<div class="input-group"> <input type="text" id="wordAutoComplete" name="word" class="form-control" placeholder="Word or Phrase" aria-label="..."> <div class="input-group-btn"> <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button> <a asp-controller="Dictionary" asp-action="Index" class="btn btn-default" title="How to use Word/Phrase search ?"><i class="fa fa-question"></i></a> </div> </div>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

5reactions
shazzababscommented, Nov 7, 2017

I found a workaround by doing the following:

Add the following line to the easy-autocomplete options object:

cssClasses: "form-control form-control-sm fix-autocomplete",

Add the following CSS:

.fix-autocomplete {
  padding : 0px !important;
  margin : 0px;
  border-width : 0px;
}

.input-grp-autocomplete
{
	padding-bottom: 2px !important;
}

Add the class input-grp-autocomplete to the input control of the input group. Note that I am using form-control-sm so you may have to adjust the input control padding more or less if you are using the large version.

Be nice to see a proper fix though.

2reactions
igorlovriccommented, Nov 2, 2017

Regarding first problem (First item not visible), I know what is the problem, but I don’t know how to fix it. If you use input-group, (easy-autocomplete-container top)=(your input top), and considering easy-autocomplete-container z-index is less then your input z-index, first item is invisible, actually it’s overlapped by input. Try playing little bit with, CSS, I think it could be fixed.

And second problem… width of input… I use Bootstrap 3, but it should work for bootstrap 4 too. Just add fallowing CSS:

.easy-autocomplete {
    width: auto !important;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap 4 input-group-append not working - Stack Overflow
I just encountered this one today. I double checked my styles and scripts and everything is good. Instead of using the append and...
Read more >
Input group - Bootstrap
Input group. Easily extend form controls by adding text, buttons, or button groups on either side of textual inputs, custom selects, and custom...
Read more >
Bootstrap Form Inputs (more) - W3Schools
Bootstrap Input Groups ... The .input-group class is a container to enhance an input by adding an icon, text or a button in...
Read more >
Input groups - Bootstrap - University of Houston
Screen readers will have trouble with your forms if you don't include a label for every input. For these input groups, ensure that...
Read more >
input-group elements are NOT responsive
Expected behavior: When a <div class="input-group"> is rendered within a responsive element it should flex to fill the ... It should solve the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found