Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-dom): fix conflicts between v-show and style display binding #4770

Closed
wants to merge 2 commits into from

Conversation

zhaozhongyu
Copy link

fix #4768

@edison1105 edison1105 added the need test The PR has missing test cases. label Oct 9, 2021
@edison1105
Copy link
Member

BTW, the test case should cover #4424

Co-authored-by: edison <daiwei521@126.com>
@zhaozhongyu
Copy link
Author

BTW, the test case should cover #4424

i had test undefined and it seems to work well.

@yyx990803
Copy link
Member

It seems unnecessary to store the state in an additional property. 3f38d59 should revert it to original behavior while still fixing #4424.

@yyx990803 yyx990803 closed this Oct 9, 2021
@zhaozhongyu
Copy link
Author

It seems unnecessary to store the state in an additional property. 3f38d59 should revert it to original behavior while still fixing #4424.

The commit 3f38d59 has conflicts between v-show and style display binding, testcases

it('should keep style "display:none" attribute on v-show control', () => {
    const el = document.createElement('div')
    el.style.cssText = 'display: none;';
    (el as any)._vod = '';
    patchProp(el as any, 'style', {}, { display: 'block' })
    expect(el.hasAttribute('style')).toBe(true)
    expect(el.style.display).toBe('none')
  })

  it('should keep style "display:none" attribute on v-show control2', () => {
    const el = document.createElement('div')
    el.style.cssText = 'display: none;';
    (el as any)._vod = '';
    patchProp(el as any, 'style', '', 'display:block;')
    expect(el.hasAttribute('style')).toBe(true)
    expect(el.style.display).toBe('none')
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need test The PR has missing test cases.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v-show conflicts with style display binding
3 participants