Subscribe on changes!

`popover` attribute causing error in Chrome version 109

avatar
Jan 20th 2023

Vue version

3.2.45

Link to minimal reproduction

https://codesandbox.io/s/silly-pike-85lncp?file=/src/App.vue:60-115

Steps to reproduce

User latest chrome version (109) and add an attribute with the name popover to your component.

<calendar :popover="popover"/>

What is expected?

No error in console.

What is actually happening?

Error in console:

Found a 'popover' attribute. If you are testing the popover API, you must enable Experimental Web Platform Features. If not, note that custom attributes must start with 'data-': https://html.spec.whatwg.org/multipage/dom.html#custom-data-attribute. This usage will likely cause site breakage when the popover API ships: https://chromestatus.com/feature/5463833265045504.

System Info

No response

Any additional comments?

Might be related to this issue: https://github.com/vuejs/vue/issues/273

avatar
Jan 20th 2023

Not sure what should be wrong here. Component props that are not declared in the component will fall through on the component's root element as HTML attributes. That's a Vue behavior ever since Vue 2.

It just so happens that Chrome warns about this particular HTML attribute.

Solution: A) remove it if your don't need it or B) declare it as a prop in the component if you expect it, or C) set ìnheritAttrs: false` in the child.

not a bug.