You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2017/03/02 00:13:58 UTC

[FlexJS] white-space: nowrap in containers

Hi,

Any reason container adds white-space: nowrap to the innermost generated span? This means any text wider than the container will overflow over the RHS rather than wrap as expected.

AFAICK there no easy way to change the white-space property of the constructed divs. Am I missing a bead or other way of fixing this?

Thanks,
Justin

Re: [FlexJS] white-space: nowrap in containers

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Yes. To force a Label to be single line.

I guess that makes sense when you have MultiLineLabel. So should it ignore <br />’s in html=“…<br />….” then?

> If you want the text to wrap, use MultiLineLabel.

The header docs for MultiLineLabel could do with an update I think, other than it name it’s hard to know what it doing from looking at the code. It's multi line because it commits code that label includes basically.

/*
*  Label probably should extend TextField directly,
*  but the player's APIs for TextLine do not allow
*  direct instantiation, and we might want to allow
*  Labels to be declared and have their actual
*  view be swapped out.
*/

  /**
   *  The Label class implements the basic control for labeling
   *  other controls.  
   *  
   *  @langversion 3.0
   *  @playerversion Flash 10.2
   *  @playerversion AIR 2.6
   *  @productversion FlexJS 0.0
   */ 

Also might be easier understood if it had an explicit set of whiteSpace in there?
element.style.whiteSpace = “normal";

Thanks,
Justin

Re: [FlexJS] white-space: nowrap in containers

Posted by Harbs <ha...@gmail.com>.
Yes. To force a Label to be single line.

If you want the text to wrap, use MultiLineLabel.

> On Mar 2, 2017, at 2:54 AM, justin@classsoftware.com wrote:
> 
> Hi,
> 
> Actually white-space: nowrap is on the Label not the Container but the question is still anyone know why that was added?
> 
> Thanks,
> Justin


Re: [FlexJS] white-space: nowrap in containers

Posted by ju...@classsoftware.com.
Hi,

Actually white-space: nowrap is on the Label not the Container but the question is still anyone know why that was added?

Thanks,
Justin