Thanks Alex, but - as a follow-on, do you think the styleName setter should set the className if it has a string value assignment? Or should we be telling people to manually edit the code/mxml and swap styleName string value assignments to 'className' value assignments? I think for the majority of cases (which I think will be string values), it might be good to have it 'work by default' and we can add the warnings for non-strings, like you suggest, but I just wanted to be sure that it is better to 'emulate' than to force review/attention....
On Thu, May 7, 2020 at 5:03 PM Alex Harui <aha...@adobe.com.invalid> wrote: > Without thinking too hard, I would output a warning if someone passes > something other than a string. Then we'll know if anybody really needs the > more complex cases and can figure out what to do about it then. > > -Alex > > On 5/6/20, 2:11 PM, "Greg Dove" <greg.d...@gmail.com> wrote: > > This question is mainly for Alex or anyone else involved in porting an > MXRoyale application. > > When porting styleName='myStyleName' what is considered the best > approach? > > I would have assumed that styleName could simply be added to the > underlying > element's classList if it is a string, so it (I assume) would > correspond > closely to how it was used in the original Flex app. But I know > styleName > is not always a string in Flex, but in my experience that seems to be > the > most frequent case, which relates to a named declaration in the > stylesheet. > > Alex, and others, what are your thoughts? I am dealing with a large > codebase and would like to use a consistent approach from the outset. > > At the moment we have; > > set styleName(value:Object /* String, CSSStyleDeclaration, or > UIComponent > */):void > ... > // TODO > trace("styleName not implemented"); > > if it is a string, then I assume it could be considered as a > custom/arbitrary css class, similar to how I remember it working in > Flex. > > UIComponent seems more problematic I assume, but I have not thought too > deeply about it. > > Anyway I would welcome thoughts. I guess one simple option is simply to > change it to className when porting if it is a string. But for > MXRoyale I > wondered if this should work (if it can) without changes.... > > >