The following Jade code
body
div.container
div.jumbotron
h2 What do you want to find?
form(action='/search', method='get')
div.input-group
input.typeahead.form-control(
type='text',
name='q',
placeholder='Search'
)
div.input-group-btn
button.btn.btn-default(type='submit')
i.glyphicon.glyphicon-search
translates to this HTML (according to Chrome’s F12):
<div class="container">
<div class="jumbotron">
<h2>What do you want to find?</h2>
<form action="/search" method="get">
<div class="input-group"><span class="twitter-typeahead" style="position: relative; display: inline-block;"><input type="text" class="typeahead form-control tt-hint" readonly="" autocomplete="off" spellcheck="false" tabindex="-1" dir="ltr" style="position: absolute; top: 0px; left: 0px; border-color: transparent; box-shadow: none; opacity: 1; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255);"><input type="text" name="q" placeholder="Search" class="typeahead form-control tt-input" autocomplete="off" spellcheck="false" dir="auto" style="position: relative; vertical-align: top; background-color: transparent;"><pre aria-hidden="true" style="position: absolute; visibility: hidden; white-space: pre; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; word-spacing: 0px; letter-spacing: 0px; text-indent: 0px; text-rendering: auto; text-transform: none;"></pre><div class="tt-menu" style="position: absolute; top: 100%; left: 0px; z-index: 100; display: none;"><div class="tt-dataset tt-dataset-found-torrents"></div></div></span>
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i>
</button>
</div>
</div>
</form>
</div>
</div>
If you run it, you’ll get the following result:
https://jsfiddle.net/kbjLmqeh/
As you can see, the input box doesn’t have the correct size because of the some invalid interaction between bootstrap and typeahead.
How can I fix it?
2
Answers
Apparently someone solve it, in this jsfiddle, by changing de CSS file.
This is the CSS:
Hopefully this helps: you can adjust the button yourself so it’s inline with your input along with making the input 100% width.
Jade
See working example Snippet.