ng-select 按钮打开文件系统对话两次

ng-select button opens file system dialogue twice

所以我正在追踪一个我无法完全解决的错误。问题是这样的,如果你有一个带有 ng-select 的按钮,取消浏览器的焦点(点击桌面)然后双击按钮,它会打开浏览器文件系统对话框两次,扔掉第一个输入。问题是如何强制它只打开文件对话框一次。

相关代码:

<!-- Table Buttons -->
<div class="container dashboard__table__action-items-container" ng-if="user.Welcomed">
    <button class="btn btn-primary" ngf-select="onFileSelect($files)" ngf-multiple="true" style="margin-right: 15px;">
        <i class="fa fa-cloud-upload fa-3" style="margin-right: 4px"></i> Upload Meeting
    </button>

...     

</div>

编辑: 我用几个浏览器测试了这个行为,但没有发生(firefox、safari、opera)。这只发生在 chrome。 ng-file-upload 的版本是 12.2.9,chrome 版本 52.0.2743.116.

所以我通过绕过它最终 "solving" 这个,但我仍然认为这是 chrome and/or ng-file-select 的错误。对于后代,如果将按钮包装在具有 ngf-select 的 div 中,则可以手动对事件传播进行反跳。

相关代码:

html:

<div ngf-select="onFileSelect($files)" ngf-multiple="true" style="width: 0;">
    <button class="btn btn-primary" ng-click="debounceMeetingCreation($event)" style="margin-right: 15px;">
        <i class="fa fa-cloud-upload fa-3" style="margin-right: 4px"></i> Upload Meeting
    </button>
</div>

在控制器中:

var meetingCreationClicked;
$scope.debounceMeetingCreation = function ($event) {
    if (meetingCreationClicked) {
        $event.preventDefault();
        $event.stopPropagation();
        return false;
    }

    meetingCreationClicked = true;

    $timeout(function(){
        meetingCreationClicked = false;
    }, 1000);
};