Hi Alex,

Sorry about that. Let me show you code and I recorded GIF with problem
debugging.

*Code in UIBase which I have implemented:*
addClassName and removeClassName [1].
addedToParent what is happen with internal field which I have added [2]

*Code for Testing* [3] - I'm adding first className, than shadow.

*GIF* [4] We are starting from the constructor. Pay attention to the moment
where className is being wiped out, later I have to use my internal
variable to get it back.

Does that more clean now ?

[1] https://paste.apache.org/EumG
[2] https://paste.apache.org/ArmU
[3] https://paste.apache.org/Krxq
[4] https://1drv.ms/u/s!ApVpLyjpHDC2hPtoCi65kIZZPwjSpQ

Thanks,
Piotr

2018-02-27 23:31 GMT+01:00 Alex Harui <aha...@adobe.com.invalid>:

> Hi Piotr,
>
> I could not understand this explanation. Might be better to show actual
> code.  For example in #3, there is a cssClass variable that I don't know
> about.  Also you mention at the bottom setting something as empty, but I'm
> not sure what that is.
>
> However, IMO, this code should be in utility functions, not in UIBase.  I
> think plenty of useful applications can be built without changing
> classNames at runtime.
>
> I'm off-line for the next several hours so we can pick this up again in
> your morning.
>
> Thanks for working on it,
> -Alex
>
> On 2/27/18, 2:21 PM, "Piotr Zarzycki" <piotrzarzyck...@gmail.com> wrote:
>
> >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://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fwww.pat
> >>reon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com
> %7C45a065853ba1
> >>4a295d9d08d57e3082b9%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C0%7C6365536
> >>69427477536&sdata=tOlZF%2FWAGhqn1toqJCCqjc14NZU56MnZZK
> 9liXcy%2BPg%3D&rese
> >>rved=0
> >>
> >><https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fwww.pat
> >>reon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com
> %7C45a065853ba1
> >>4a295d9d08d57e3082b9%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C0%7C6365536
> >>69427477536&sdata=tOlZF%2FWAGhqn1toqJCCqjc14NZU56MnZZK
> 9liXcy%2BPg%3D&rese
> >>rved=0>*
> >>
> >
> >
> >
> >--
> >
> >Piotr Zarzycki
> >
> >Patreon:
> >*https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fwww.patr
> >eon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%
> 7C45a065853ba14a
> >295d9d08d57e3082b9%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C0%7C6365536694
> >27477536&sdata=tOlZF%2FWAGhqn1toqJCCqjc14NZU56MnZZK
> 9liXcy%2BPg%3D&reserved
> >=0
> ><https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fwww.patr
> >eon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%
> 7C45a065853ba14a
> >295d9d08d57e3082b9%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C0%7C6365536694
> >27477536&sdata=tOlZF%2FWAGhqn1toqJCCqjc14NZU56MnZZK
> 9liXcy%2BPg%3D&reserved
> >=0>*
>
>


-- 

Piotr Zarzycki

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

Reply via email to