Here is how I'm thinking to resolve that issue. I would take Harb's
proposition and add to UIBase  addClassName() and removeClassName(). Next I
would add internal field _internalClassName:String.

addClassName(value):
1) Will check if provided class name exits in _className and in
_internalClassName.
2) Will add to _internalClassName += value
3) Assign to the element.className in the following way: element.className
= cssClass + " " + _className + " " + typeNames;

removeClassName(value)
1) Will check if provided classs name exists in  _className or in
_internalClassName
2) Make a replace to empty string if css class name exists.
_className.replace(value, "");
3) Assign to the element.className: element.className = _className + " " +
typeNames;

In added to parent we are computing _internalClassName with _className and
typeNames. Then it's being set as empty.

element.className =  _internalClassName  + " " + _className + " " +
typeNames;

I have implemented it and it seems to be working. Waiting for your thoughts
on that solution. The last step where we are adding all three fields is the
most important. Points 3 in addClassName and removeClassName are necessary,
because user may want to more dynamically manipulate classes once component
is created. Ex. "is-active" class is removed and added on demand.

Thanks, Piotr


2018-02-27 13:38 GMT+01:00 Piotr Zarzycki <piotrzarzyck...@gmail.com>:

> I think I have analyzed everything and have some implementation
> proposition. I will try to provide it later today.
>
> Thanks, Piotr
>
> 2018-02-27 13:35 GMT+01:00 Harbs <harbs.li...@gmail.com>:
>
>> ExpandableSearch broke too.
>>
>> > On Feb 25, 2018, at 6:15 PM, Piotr Zarzycki <piotrzarzyck...@gmail.com>
>> wrote:
>> >
>> > Harbs,
>> >
>> > If you are using something more than MDL Dialog in your application it
>> > would be great to get feedback whether I didn't break for you anything.
>> :)
>>
>>
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> <https://www.patreon.com/piotrzarzycki>*
>



-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Reply via email to