Hi,

found an issue with MDL and custom class.

If you declare a component that has some new custom additional class (lets
call "someClass"), and has some property that modifies the className (in
our case always through classList API), let's say is a button, and this is
the example:

<mdl:Button colored="true" className="someClass"/>

the result is the colored className is remove from the list of applied
classes, since is not part of "typeNames" and className implementation
overrides all

We must say that properties that modifies className in MDL like "ripple",
"colored", etc... are by definition "behaviors" that use CSS (classNames)
to modify some visual aspect of the component or control, so me want don't
be affected if we apply a custom className like "someClass" right?

So If we set "colored" to true, we want the component maintains the
className that is applied and if we set to false we want to be remove from
classNames, and in no other way,

so the solution I have is to add a line in *each* property of each
component in MDL just behind the classList.add or classList.toggle
instruction that should be:

typeNames = element.className;

So, in this way we make the property part of typeNames while is activated
and if removed, we remove as well from typeNames, giving the control of
that visual aspect only to the setter of the property

I'll make that change tomorrow (it's very late here), if no body finds any
problem.

After much testing I don't see other way

Thanks

-- 
Carlos Rovira
http://about.me/carlosrovira

Reply via email to