When using FlexBox (FlexLayoutModule) I've stumbled across a problem I'm unable to fix.
For reference look here: https://stackblitz.com/edit/mortom-flexbox-overflow
Suppose I have some kind of chat
which consists of some messages displayed below each other. Therefore the outer container has flexLayout="column"
.
A message
consists of a name and a text which are displayed side-by-side.
Each of the messages should only inhibit 75% of the container width. (not that important / if you change max-width
to 100% it simply overflows the viewport in the given example).
Now, when using long words the max-width
of the container gets ignored, although the css specifes overflow-wrap: break-word
.
Note: the overflow-amount of the actual message text, matches the width of the name - div, so when shortening the name, the overflow gets less notable.
How can I fix this, so that the message text wraps correctly and the specified max-width
for the messageContainer
is the actual max-width
of a message
?
Feel free to ask for clarification or post links to other threads, sadly I wasn't able to find a solution or correctly apply possible solutions.