How to close uib-popover when clicking outside?

1

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.

    
asked by anonymous 26.09.2016 / 14:47

1 answer

1

Fucking Github back and forth, I've come to the conclusion that it's an update problem.

It was reported in one of the Issue , that this had been removed since version 1.3.3 .

However, when reading another Issue, it was informed that in the most recent versions of the Angular UI Bootstrap, instead of using popover-trigger="outsideClick" you should use popover-trigger="'outsideClick'" .

The Issue I read this is this

    
26.09.2016 / 15:58