Prechádzať zdrojové kódy

Prevent multiple submissions of the same property.

Afshin Darian 7 rokov pred
rodič
commit
1681daf703

+ 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;