Skip to content

Commit

Permalink
Revert "fix(runtime-dom/style): fix patchStyle on falsy next value (v…
Browse files Browse the repository at this point in the history
…uejs#1504)"

This reverts commit 77538ec.
  • Loading branch information
jiangying000 authored Jul 7, 2020
1 parent a5b4332 commit 5bec06e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions packages/runtime-dom/__tests__/patchStyle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ describe(`runtime-dom: style patching`, () => {
expect(el.style.getPropertyValue('margin-right')).toBe('10px')
})

it('patch with falsy style value', () => {
const el = document.createElement('div')
patchProp(el as any, 'style', { width: '100px' }, { width: 0 })
expect(el.style.width).toBe('0px')
})

// JSDOM doesn't support custom properties on style object so we have to
// mock it here.
function mockElementWithStyle() {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-dom/src/modules/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function patchStyle(el: Element, prev: Style, next: Style) {
}
if (prev && !isString(prev)) {
for (const key in prev) {
if (next[key] == null) {
if (!next[key]) {
setStyle(style, key, '')
}
}
Expand Down

0 comments on commit 5bec06e

Please sign in to comment.