I have an input box in a form. I am using the easyautocomplete plugin in this input box. When I have input box outside the input-group-addon
the input box has proper width. But, when I add it inside the input-group-addon
, the width is reduced/collapsed. (See screenshots)
HTML With input-group-addon
<div class="form-group col-md-9">
<label for="taskname">Task Name</label>
<div class="input-group">
<span class="input-group-addon"><i class="fas fa-anchor"></i></span>
<input class="form-control" id="taskname" name="taskname" required autocomplete="off" maxlength="50" placeholder="Name" value="<?php echo h($dataset['taskname']); ?>">
</div>
<small class="form-text text-muted">Select Task name from auto suggestion or type your own </small>
</div>
HTML Without input-group-addon
<div class="form-group col-md-9">
<label for="taskname">Task Name</label>
<input class="form-control" id="taskname" name="taskname" required autocomplete="off" maxlength="50" placeholder="Name" value="<?php echo h($dataset['taskname']); ?>">
<small class="form-text text-muted">Select Task name from auto suggestion or type your own </small>
</div>
Javascript
$("#taskname").easyAutocomplete(tasknameoption);
var tasknameoption = {
url: "/task/tasklistapi.php",
getValue: "tasklistname",
adjustWidth: false,
requestDelay: 500,
list: {
maxNumberOfElements: 10,
match: {enabled: true},
onSelectItemEvent: function() {
var value = $("#taskname").getSelectedItemData().iscomp;
$("#iscomp").val(value).trigger("change");
}
}
};
When the above javascript is commented, the form looks as below
Things I have Tried (but did not work):