-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
vjs.obj.merge and vjs.createEl don't handle HTML attributes (which are case-insensitive) correctly #2176
Comments
Good catch. The This process is a little complicated too because we've combined properties and attributes into the same process, with some light translation between them, but they're really two different concepts that should be handled separately. We discussed this briefly in a previous issue. The best idea from that was to add a second arg to createEl for handling attributes.
So we need to fix tabIndex first and then improve createEl. Confirming this issue. Anyone feel free to pick it up. We should try to get the createEl change into 5.0. |
I fixed the tabIndex note in #2204. I'm going to shift the createEl change to 5.1 so we can get 5.0 out, but we should make sure createEl doesn't get exported without this. |
@OwenEdwards FYI I submitted #2589 to fix the properties/attributes issue. |
HTML attributes are case-insensitive. JavaScript and vjs.obj.merge are case sensitive, so a merged object may contain two variables which are different only because of their case. vjs.createEl simply iterates through the properties object, applying them to the new element in the order it finds them; the el.setAttribute method it uses is case insensitive, but order matters.
So if this code were used:
the button element's
tabIndex
would not be set correctly.(Note that this problem doesn't seem to have surfaced in the existing code, but it has the potential to; I discovered it while doing some development/enhancement. The attribute
tabIndex
is already used in both lower-case and camel-case in the existing code, so the potential to cause a problem is there).The text was updated successfully, but these errors were encountered: