소스 검색

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;