ソースを参照

remove unecessary change

Hugo Di Francesco 5 年 前
コミット
6bac86f58c
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/directives/bind.js

+ 2 - 2
src/directives/bind.js

@@ -69,10 +69,10 @@ export function handleAttributeBindingDirective(component, el, attrName, express
             el.setAttribute('class', arrayUnique(originalClasses.concat(newClasses)).join(' '))
         }
     } else if (isBooleanAttr(attrName)) {
-        if (!!value) {
+        // Boolean attributes have to be explicitly added and removed, not just set.
+        if (!! value) {
             el.setAttribute(attrName, '')
         } else {
-            // If a Boolean attribute has a falsy value, remove the attribute
             el.removeAttribute(attrName)
         }
     } else {