Textbox size stays fixed with Bootstrap 3.2
See original GitHub issueBootstrap ver: 3.2 Typeahead ver: 0.10.5
Issue: When using typeahead 0.10.5 with Bootstrap 3.2, the textbox is automatically resizes to a fixed 120px width and does not allow for auto-resizing.
For instance, notice that the 2nd textbox will resize and stretches to the full width of it’s DIV, where as the one wrapped in DIV ID=“the-states” stays at a fixed width. Thus breaking the fluid / adjustable form.
Please address this issue
Workaround: None
Reproduce Sample:
{# Note i'm using the standard typeahead.css v0.10.5, unmodified #}
<head>
<link rel="stylesheet" href="libs/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="libs/bootstrap/css/bootstrap-theme.min.css" />
<script src="libs/jquery/jquery-1.11.1.min.js"></script>
<script src="libs/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="typeahead.bundle.min.js" ></script>
<link rel="stylesheet" href="typeahead.css" />
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
var substringMatcher = function(strs) {
return function findMatches(q, cb) {
var matches, substrRegex;
matches = [];
substrRegex = new RegExp(q, 'i');
$.each(strs, function(i, str) {
if (substrRegex.test(str)) {
matches.push({ value: str });
}
});
cb(matches);
};
};
var states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California'];
$('#the-states .typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
},
{
name: 'states',
displayKey: 'value',
source: substringMatcher(states)
});
});
</script>
<div class="container-fluid">
<form class="form-horizontal" role="form">
<div class="panel">
<div class="panel-body">
<div class="row">
<!-- This input stays at a FIXED WIDTH -->
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="inputEmail" class="col-md-4 control-label">Email:</label>
<div class="col-md-8" id="the-states" >
<input type="text" id="txtInput1"
class="typeahead input-sm form-control"
autocomplete="off"
spellcheck="false"
placeholder="Sales Rep"
/>
</div>
</div><!-- form-group -->
</div><!-- col-sm-6 col-lg-4 -->
<!-- This box shows correctly and resizes correctly -->
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="inputPassword" class="col-md-4 control-label">Password:</label>
<div class="col-md-8">
<input type="password" class="form-control" id="inputPassword" placeholder="Password">
</div>
</div><!-- form-group -->
</div><!-- col-sm-6 col-lg-4 -->
</div><!-- row -->
</div><!-- panel-body -->
</div><!-- panel -->
</form>
</div>
</body>
Issue Analytics
- State:
- Created 9 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
CSS · Bootstrap 3.3.2 Documentation
Here's how the Bootstrap grid system works: Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and ...
Read more >Input widths on Bootstrap 3 - css
Inputs, selects, and textareas are 100% wide by default in Bootstrap. To use the inline form, you'll have to set a width on...
Read more >Position · Bootstrap
Fixed bottom. Position an element at the bottom of the viewport, from edge to edge. Be sure you understand the ramifications of fixed...
Read more >Position · Bootstrap v5.0
Be sure you understand the ramifications of fixed position in your project; you may need to add additional CSS. Copy. <div class="fixed-top"> ...
Read more >Components
Justified button groups. Make a group of buttons stretch at equal sizes to span the entire width of its parent. Also works with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found the fix, PLEASE INCLUDE THIS IN YOUR DOCUMENTATION!
@DevChive
If you add the width: 100% to the drop down it will extend the entire input too: