IMO, your proposed change adds code "just-in-case" someone wants to change from 
sizing-to-parent to sizing-to-content.  We've written lots of FlexJS/Royale 
code over the years that works just fine without that change.  That implies to 
me that this scenario is not a "standard case".

If you want to build that in as a standard case to Jewel, that's fine.  Jewel 
does not have to be as lightweight as Basic.

If, over more years, we hear more folks with these cases for Basic then we can 
consider adding it to Basic, but I would probably just add a Utils function 
like "sizeToContent()" that "does the right thing".  In some component sets, 
sizing to content might force a measuring API to run, for example.

IMO, it is better to think of the "semantics" or "meaning" of some code so that 
we don't bake platform-specific patterns into the framework.  We want the 
framework to be easily portable to other runtimes someday.

My 2 cents,
-Alex

On 12/19/19, 2:47 AM, "Carlos Rovira" <[email protected]> wrote:

    Hi Alex,
    
    My perception for this particular case in the JS platform we are missing a
    standard case.
    To try to make a comparison is like if we could add to an int var any
    number except "0".
    
    IMHO, the PAYG concept does not apply since Basic (and any other set)
    should need in some cases to remove width (so browsers apply the default)
    and that make JS set "width=null'" to remove it.
    IOW, we are not translating correctly to JS in all possible cases.
    
    In other words we have in UIBase this code:
    
    this.positioner.style.width = value.toString() + '%';
    
    I tested UIBase with this change worked:
    
    this.positioner.style.width = isNaN(value) ? null : value.toString() + 'px';
    
    It's ok to do this change?
    
    Thanks
    
    Carlos
    
    
    
    El jue., 19 dic. 2019 a las 3:57, Alex Harui (<[email protected]>)
    escribió:
    
    > Basic has the most minimal support for changing things.  Supporting change
    > takes more code, so because of PAYG, only the most expected change are
    > supported.
    >
    > What is the "semantics" behind removing percentWidth?  That you want
    > something to go back to sizing to its content?  One option is that could 
be
    > a utils function like sizeToContent(widget:IUIBase) that knows how to
    > manipulate a particular component set's widgets.  What needs to be done to
    > a component might depend on the component set.
    >
    > My 2 cents,
    > -Alex
    >
    > On 12/18/19, 2:32 PM, "Carlos Rovira" <[email protected]> wrote:
    >
    >     Hi,
    >
    >     I think I had this issue at other time.
    >
    >     Let's say we have a container where percentWidth is configured to 100,
    > so
    >     in html this is:
    >
    >     <div style="width:100%"/>
    >
    >     then we need to remove style="width:100%" so we end with:
    >
    >     <div/>
    >
    >     In royale we can do container.percentWidth=100, but there's no way 
back
    >     right?
    >     we can't do container.percentWidth = NaN or undefined.
    >
    >     Or I'm missing something?
    >
    >     Thanks
    >
    >
    >     --
    >     Carlos Rovira
    >
    > 
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C13eeb2da99794184130808d78470c91e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637123492262709656&amp;sdata=Y9dgWYv6MBciK4NN3zcbJBnslZWXTlIB1twCcds4xsU%3D&amp;reserved=0
    >
    >
    >
    
    -- 
    Carlos Rovira
    
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C13eeb2da99794184130808d78470c91e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637123492262709656&amp;sdata=Y9dgWYv6MBciK4NN3zcbJBnslZWXTlIB1twCcds4xsU%3D&amp;reserved=0
    

Reply via email to