react-truncate icon indicating copy to clipboard operation
react-truncate copied to clipboard

Does not collapse on initial page load even though expanded is set to false

Open nupurkapoor opened this issue 7 years ago • 1 comments

UPDATE I realized its the same issue as mentioned here https://github.com/One-com/react-show-more/issues/10 Even if I dont integrate with the react-show-more the element starts off fully rendered, then reduces its height to be truncated. Is there any fix for this? How have other people handled this?

nupurkapoor avatar Jan 04 '18 01:01 nupurkapoor

I handled this by setting an initial text state to '...', then in componentDidMount(), set it to props.children. There will be a flash of content, but at least it's better than showing the entire text initially. https://www.webpackbin.com/bins/-L4HvObkgDRAzFxBHYO8

deepak90 avatar Feb 01 '18 20:02 deepak90