Merge branch 'MDL-70580' of git://github.com/paulholden/moodle
authorJun Pataleta <jun@moodle.com>
Wed, 13 Jan 2021 02:20:20 +0000 (10:20 +0800)
committerJun Pataleta <jun@moodle.com>
Wed, 13 Jan 2021 02:20:20 +0000 (10:20 +0800)
lib/amd/build/tree.min.js
lib/amd/build/tree.min.js.map
lib/amd/src/tree.js

index ea1b92d..1d9c1c8 100644 (file)
Binary files a/lib/amd/build/tree.min.js and b/lib/amd/build/tree.min.js differ
index a78d746..46c0374 100644 (file)
Binary files a/lib/amd/build/tree.min.js.map and b/lib/amd/build/tree.min.js.map differ
index 1a97cac..167e7bb 100644 (file)
@@ -491,9 +491,9 @@ define(['jquery'], function($) {
             return;
         }
 
-        var item = $(e.target);
-
-        if (e.target !== e.currentTarget) {
+        // Get the closest tree item from the event target.
+        var item = $(e.target).closest('[role="treeitem"]');
+        if (!item.is(e.currentTarget)) {
             return;
         }