-
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
Added an 'attributes' arg to createEl() #2589
Conversation
// We originally were accepting both properties and attributes in the | ||
// same object, but that doesn't work so well. | ||
if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') { | ||
log.warn(`Setting attributes in the second argument of createEl() |
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.
does this have a bunch of extra whitespace in it? Might want to grab https://www.npmjs.com/package/tsml
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.
Cool. Pulled in tsml.
LGTM, we probably want to mention this in the wiki for the 5.0 transition. |
Yeah, good point. I'll add it. On Mon, Sep 14, 2015 at 8:38 PM, Gary Katsevman [email protected]
|
@@ -29,25 +31,28 @@ export function getEl(id){ | |||
* @return {Element} | |||
* @function createEl | |||
*/ | |||
export function createEl(tagName='div', properties={}){ | |||
export function createEl(tagName='div', properties={}, attributes={}){ |
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.
the jsdocs for this were never added.
Also, we should probably document exactly what the different between the two would be.
fixes #2176
Properties and attributes need to be handled separately in createEl(). This adds a third arg for attributes and a deprecation warning for the cases were we expected attributes to come through the properties object.