Famous / engine

MIT License
1.75k stars 250 forks source link

[question] Render Size DOM wrapps the text in 2 lines #495

Closed elinfante closed 8 years ago

elinfante commented 8 years ago

Hello,

Is there a reason why having a Render Size Node when I add some text that has more than 1 word, It wrapps it in 2 lines? Not even using CSS I can have the text in 1 line. Is there anything I am doing wrong?

Any advise would be appreciated.

Screenshot of what the issue is. I was expecting to have 'Hello World' in 1 line... 2lines

trusktr commented 8 years ago

@elinfante What happens if you set nowrap on the text so it's on one line?

elinfante commented 8 years ago

@trusktr I have tried to set the CSS as white-space: nowrap; but does not make any difference.

For what I can see, when It sets the content of the DOM (NODE is render size) for the first time gets the width of the first word and the wraps the other one, and If I replace the content and the new content is smaller than the first word then It does now wrap. I think It is a bug but I just wanted ton confirm with you guys jus in case I am doing somehting wrong.

trusktr commented 8 years ago

I don't think it's an issue in Famous. Try putting your text in a span? @elinfante

elinfante commented 8 years ago

@trusktr I have done that as well and still wrapping the text. I am not sure about not being a bug. Can you setup a very simple test that contains "Hello world" in 1 line? All my attempts I have failed..

elinfante commented 8 years ago

@trusktr : If the parent's width is big enough to accomodate both words then the behaviour is as expected. I will around that. Thanks for your help!!!

trusktr commented 8 years ago

@elinfante SOrry for the late reply. I'm focusing on infamous/motor, so we'll eventually make sure it works there. ;)