-
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
feature: Remove support for setting nonstandard attributes as props #7857
Conversation
Codecov Report
@@ Coverage Diff @@
## next #7857 +/- ##
==========================================
+ Coverage 81.60% 81.78% +0.17%
==========================================
Files 110 111 +1
Lines 7350 7373 +23
Branches 1777 1779 +2
==========================================
+ Hits 5998 6030 +32
+ Misses 1352 1343 -9
Help us with your feedback. Take ten seconds to tell us how you rate us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with one small change!
src/js/utils/dom.js
Outdated
textContent(el, val); | ||
} else if (el[propName] !== val || propName === 'tabIndex') { | ||
el[propName] = val; | ||
} | ||
}); | ||
|
||
Object.getOwnPropertyNames(attributes).forEach(function(attrName) { | ||
el.setAttribute(attrName, attributes[attrName]); | ||
Object.entries(attributes).forEach(([attrName, val]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we can't use entries
. Our minimum Chromium version will be 53 (because of WebOS 4.x) and it wasn't added until Chromium 54. 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, quick change there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…7857) * remove statement that handles attributes in props argument * clean up function * add unit test * add unit test * remove duplicate set attr * revert function cleanup
…7857) * remove statement that handles attributes in props argument * clean up function * add unit test * add unit test * remove duplicate set attr * revert function cleanup
…ideojs#7857) * remove statement that handles attributes in props argument * clean up function * add unit test * add unit test * remove duplicate set attr * revert function cleanup
Amend the
createEl
method on the Dom class to remove logic that allowsrole
,type
, andaria-*
attributes to be set as part of the properties object on an element.Changes include:
createEl
method that checks for nonstandard attributes in the properties object and sets them as element attributes.tabIndex
attribute assignment inSlider.creatEl
method.Specific Changes proposed
Please list the specific changes involved in this pull request.
Requirements Checklist