You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text in a flex row doesn't shrink below its longest word #2921
A Text that is a flex item of a row with flexShrink: 1 or flex: 1 can't
shrink below its longest unbroken word on web. An email address or a URL,
which has no space to wrap at, stays on one line, overflows the row and
pushes the row's other children out of it. On iOS and Android the same code
wraps the word.
Expected behavior
The Text shrinks to the space the row leaves it and wraps the word, as on
native. View already does this: its base style sets minWidth: 0, which
removes the minimum CSS gives a flex item, its min-content width
(https://www.w3.org/TR/css-flexbox-1/#min-size-auto). Text's base style
doesn't set it.
Steps to reproduce
Clone the test case, run npm install, then npx expo start --web.
Each of the three rows is 240px wide and holds a Text with an email
address next to a 32px square. Under each row is the width onLayout
reports for the Text.
In Chrome 155, the rows styled flexShrink: 1 and flex: 1 report 392,
and the square sits outside the row. The row styled flexShrink: 1, minWidth: 0 reports 198 and wraps.
On an Android 17 emulator, all three rows report 198 and wrap.
react-native-web 0.21.4 (master at 3edc3e3 has the same Text styles),
React Native 0.88.0, Expo SDK 58.
Activity