chenquincy/react-ellipsis

small initial text

meeshh opened this issue · 3 comments

If text property is a string that is less than maxLine, the ellipsisNode still shows. The maxLine prop should be static in my useCase but the text is dynamic.
Image attached

<Ellipsis
      text='My short text'
      ellipsis={ellipsisState}
      maxLine={3}
      reflowOnResize
      onEllipsisClick={toggleReadMore}
      ellipsisNode={<strong> ...{ellipsisState ? t('readMore') : t('readLess')}</strong>}
      endExcludes={[' ', ',', '.']}
/>

image

Solved with the onReflow callback. But isn't it better if it works out of the box?
Thanks

@meeshh I can't reproduce your issue, can you just reproduce it on an online code website such as codepen and share the case to me?

It work well in my device.
image