typeahead.js icon indicating copy to clipboard operation
typeahead.js copied to clipboard

white-space: nowrap;

Open buschtoens opened this issue 13 years ago • 6 comments

Why do you overwrite white-space: nowrap; with white-space: normal;?

buschtoens avatar Jun 30 '13 22:06 buschtoens

Is this in reference to this?

jharding avatar Jun 30 '13 23:06 jharding

Yes, the containing div has white-space: nowrap; but the child p tag overrides it with white-space: normal

sskirby avatar Jul 11 '13 13:07 sskirby

white-space is inherited, so since I set it to nowrap on the containing div, I need to reset it to normal on the child.

jharding avatar Jul 11 '13 18:07 jharding

Hi Jake :) The problem with setting white-space: normal; for the child (the <p> tag, as sskirby mentioned) is that it leads to possible line-breaks in the suggested text. I supose that this behaviour is not wanted, right?

tangopium avatar Aug 29 '13 02:08 tangopium

Hi, I know it's an old thread but just downloaded a version and this problem is still present. I need nowrap on suggestions paragraph in my design and need to overwrite it with very ugly css. Also can't see whitespace:nowrap on a parent div anymore, so maybe its safe to simply remove setting whitespace on those p?

skuteli avatar Jun 30 '14 13:06 skuteli

@skuteli An alternative to ugly CSS is ugly HTML: use the templates.suggestion option (if you aren't already) to wrap your desired markup with a generic <div> element. You can set white-space on the children to whatever value you need.

@jharding the above is what I'm doing in my application, but if it could be avoided (as @skuteli suggests), I'd much appreciate it!

jugglinmike avatar Jul 16 '14 20:07 jugglinmike