From af90a04bd97fb3dbf87ce21ea0d64a7a67ace996 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 13 Oct 2016 13:28:24 +0800 Subject: [PATCH] FIX: All clicks should close autocomplete. --- app/assets/javascripts/discourse/lib/autocomplete.js.es6 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 index 47f8b0ff3c8..5e1d404bc9d 100644 --- a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 +++ b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 @@ -50,6 +50,8 @@ export default function(options) { .off('paste.autocomplete') .off('click.autocomplete'); + $(window).off('click.autocomplete'); + if (options === 'destroy') return; } @@ -331,6 +333,7 @@ export default function(options) { closeAutocomplete(); }); + $(window).on('click.autocomplete', () => closeAutocomplete()); $(this).on('click.autocomplete', () => closeAutocomplete()); $(this).on('paste.autocomplete', function() {