prop casing inconsistency
Vue version
@fe77e2b (3.2.45)
Link to minimal reproduction
Steps to reproduce
Define props with different attributes and check the HTML result on both Firefox and Chrome (Unix): aria-hidden
, etc.
What is expected?
Camel cased props should be always converted to kebab cased props. This behavior should be shared acrosss all browser.
What is actually happening?
On both tested browser, some camel cased attribute (aria-controls
) are not kebab cased, but not all.
On Firefox, all camel cased attribute are not kebab cased.
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
Memory: 1.27 GB / 15.00 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.0/bin/yarn
npm: 8.5.4 - ~/.nvm/versions/node/v16.14.0/bin/npm
Browsers:
Chrome: 108.0.5359.98
Firefox: 108.0.1
Any additional comments?
There is already an issue (#5477) which partially talks about this issue (but dont talk about firefox and chrome different behavior).
IMO, it is very important to fix this issue as a lot of lib are using camel cased properties when using v-bind
or JSX (and it impact accessibility a lot as some buttons miss there labels, etc.).
#7401 also is related to this, in a way. I'll try and get an overall perpective on this over the holidays.
Sidenote: I'll verify this, but suspect that the browser-inconsistencies are due to differnt handling when assigning these attributes as element properties el.ariaLabel = ....
- I'd guess Firefox simply doesn't provide these properties.
Edit: verified.
- Firefox:
'ariaLabel' in $0 // => false
- Chrome
'ariaLabel' in $0 // => true
Insofar, this issue can be considered a duplicate to #5477 - solving that issue will also solve this one here.