浏览代码

Prevent multiple submissions of the same property.

Afshin Darian 7 年之前
父节点
当前提交
1681daf703
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      packages/settingeditor-extension/src/settingeditor.ts

+ 4 - 1
packages/settingeditor-extension/src/settingeditor.ts

@@ -907,9 +907,12 @@ class PluginFieldset extends Widget {
     let target = event.target as HTMLElement;
 
     while (target && target.parentElement !== root) {
-      if (target.hasAttribute(attribute)) {
+      const active = target.classList.contains(ACTIVE_CLASS);
+
+      if (active && target.hasAttribute(attribute)) {
         event.preventDefault();
         this._onPropertyAdded(target.getAttribute(attribute));
+        target.classList.remove(ACTIVE_CLASS);
         return;
       }
       target = target.parentElement;