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
NB: This is more for bookmarking purposes, it took me a while to uncover that Sketchapp does not support overflow/ellipsis, and felt that creating an issue would allow other people a shortcut.
Expected behavior:
React Native supports text truncation using a combination of numberOfLines and ellipsizeMode.
Observed behavior:
These properties have no effect in Sketch, because the Sketch application doesn't support them.
The <Text> component supports a resizeConstraints property with booleans of top, bottom, left, right, fixedWidth and fixedHeight, and although these have an effect on the containing element, they don't prevent the text from overflowing from the element and affecting element position (when combined with style height/width).
In the screenshot, I've highlighted the long text which has been wrapped to a second line. Note also the text properties which show the resizing constraint (height) and the height of 30 specified via the style={{height:30}}.
Whilst there is no inherent support for numberOfLines or ellipsizeMode, the reason why Sketchapp renders text outside its container appears to be a Sketch rendering bug. If you select and resize the text object manually, the overflow text is immediately clipped to the object bounds.
I've tried using overflow: 'hidden' on both the Text component's style, and on its containing View but neither prevents the text from overflowing.
I've discovered that there is a technique to place Sketch shapes inside Symbols, as the symbol adds an additional clipping facility (shapes cannot exceed the bounds of the symbol) and this might provide a workaround.
👋 Hello! Thanks for contributing. Please use the template that matches your intention
I am...
| -------------------------------------------------------------------------------------------------
NB: This is more for bookmarking purposes, it took me a while to uncover that Sketchapp does not support overflow/ellipsis, and felt that creating an issue would allow other people a shortcut.
Expected behavior:
React Native supports text truncation using a combination of
numberOfLines
andellipsizeMode
.Observed behavior:
These properties have no effect in Sketch, because the Sketch application doesn't support them.
The
<Text>
component supports aresizeConstraints
property with booleans of top, bottom, left, right, fixedWidth and fixedHeight, and although these have an effect on the containing element, they don't prevent the text from overflowing from the element and affecting element position (when combined with style height/width).In the screenshot, I've highlighted the long text which has been wrapped to a second line. Note also the text properties which show the resizing constraint (height) and the height of 30 specified via the
style={{height:30}}
.How to reproduce:
NB: No point in passing
numberOfLines={1}
orellipsizeMode={'head'|'tail'|'middle'}
as they are not passed to the underlying text component.Sketch version:
48.2
Please attach screenshots, a zip file of your project, and/or a link to your github project
The text was updated successfully, but these errors were encountered: