diff --git a/src/directives/internal/style.js b/src/directives/internal/style.js index 586737ade4c..6ad49e472e3 100644 --- a/src/directives/internal/style.js +++ b/src/directives/internal/style.js @@ -112,6 +112,12 @@ function prefix (prop) { } var i = prefixes.length var prefixed + if (camel !== 'filter' && (camel in testEl.style)) { + return { + kebab: prop, + camel: camel + } + } while (i--) { prefixed = camelPrefixes[i] + upper if (prefixed in testEl.style) { @@ -121,10 +127,4 @@ function prefix (prop) { } } } - if (camel in testEl.style) { - return { - kebab: prop, - camel: camel - } - } } diff --git a/test/unit/specs/directives/internal/style_spec.js b/test/unit/specs/directives/internal/style_spec.js index 2dc6d1f0776..34c0bd1d243 100644 --- a/test/unit/specs/directives/internal/style_spec.js +++ b/test/unit/specs/directives/internal/style_spec.js @@ -121,4 +121,10 @@ describe(':style', function () { done() }) }) + + // #2654 + it('background size with only one value', function () { + dir.update({ backgroundSize: '100%' }) + expect(el.style.cssText.replace(/\s/g, '')).toBe('background-size:100%;') + }) })