I'm trying to use the uibPopover
of the Angular UI Bootstrap to display a input
field.
The problem I'm having is that by clicking off the popover, it is not closing.
I've already looked for some answers in SOEN
which says that I have to set the popover-trigger
attribute to outsideClick
or focus
. I tried both ways, but I still did not get the expected result.
The button code that activates the popover looks like this:
<button
uib-popover-template="'popover-itens-protocolo.html'"
popover-placement="top-right"
popover-title="Nova Coluna"
popover-trigger="focus"
type="button"
class="btn btn-primary">
<i class="fa fa-plus-square"></i>
</button>
<script type="text/ng-template" id="popover-itens-protocolo.html">
<form>
<div class="input-group">
<input type="text" ng-model="novaColuna" class="form-control" />
<div class="input-group-btn">
<button ng-disabled="!novaColuna" class="btn btn-primary" ng-click="adicionarNovaColuna(novaColuna)">
<i class="fa fa-plus"></i>
</button>
</div>
</div>
</form>
</script>
What is the solution to this problem?
Update : All examples I tried with clickOutside
worked perfectly, but mine does not work. I do not know if the fact that the template is being loaded externally might influence the fact, but that's how I'm doing it.