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
can't use :srcObject.prop
to set prop to null
#9138
Comments
maybe we shouldn't apply transformation for |
Now that I've looked at the code ( it('should remove the elements domProps', () => {
const vnode1 = new VNode('a', { domProps: { src: 'http://localhost/' }})
const vnode2 = new VNode('a', { domProps: {}})
patch(null, vnode1)
const elm = patch(vnode1, vnode2)
expect(elm.src).toBe('')
}) ...There's no generic way to "delete" an
(I'm sure there's a great reason for that behavior and it has legitimate use cases all over.) So in that context, empty string seems like as reasonable a default as any for null/undef props. I've experimented with changing the That said, am I making too many assumptions there? is that code purely a guard against missing props in the new vnode? was the author of the test only considering On the other hand, I guess it doesn't really make sense to talk about deletion when it comes to bound properties... like in the example of If the above suggestion sounds okay, then I would assume |
I think this was fixed by f11449d |
Version
2.5.17
Reproduction link
https://codesandbox.io/s/ppyq71wrxj
Steps to reproduce
(See minimal repro)
HTMLMediaElement
that binds:srcObject.prop
to some data property (that starts off asnull
):MediaStream
:null
:What is expected?
I expect the audio.srcObject to be null
What is actually happening?
it stays as the MediaStream and there's a TypeError in the log.
I noticed that it did actually work in my first attempt to write the repro example: https://jsfiddle.net/4tnkapxo/1/ (probably because the whole thing is inline?)
Im not sure how helpful this is, but based on the stack trace it's related to this code, found in
updateDOMProps
:isUndef(null)
is evaluating true, and so it's trying to set the prop to''
, butsrcObject
specifically needs it to benull
or aMediaStream
The text was updated successfully, but these errors were encountered: