]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent share dropdown to close too early with autocomplete
authorVincent Petry <pvince81@owncloud.com>
Mon, 7 Oct 2013 11:25:30 +0000 (13:25 +0200)
committerVincent Petry <pvince81@owncloud.com>
Mon, 7 Oct 2013 11:26:46 +0000 (13:26 +0200)
When clicking on an autocomplete result in the sharing dropdown,
it will mistakenly be detected as being clicked outside and would
trigger the sharing dropdown closing.

This fix adds a check to detect clicks inside the autocomplete and
prevent closing the dropdown in that case.

This fixes #4142

core/js/share.js

index c0ecbbf36cf2a8dcabc7aa1081dfbc5be164679d..b472797b3cd98cc277168483a72bc3764d26481a 100644 (file)
@@ -476,7 +476,7 @@ $(document).ready(function() {
        $(this).click(function(event) {
                var target = $(event.target);
                var isMatched = !target.is('.drop, .ui-datepicker-next, .ui-datepicker-prev, .ui-icon')
-                       && !target.closest('#ui-datepicker-div').length;
+                       && !target.closest('#ui-datepicker-div').length && !target.closest('.ui-autocomplete').length;
                if (OC.Share.droppedDown && isMatched && $('#dropdown').has(event.target).length === 0) {
                        OC.Share.hideDropDown();
                }