Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customization of overflow element #64

Open
wencyen opened this issue Jan 31, 2023 · 1 comment
Open

Support customization of overflow element #64

wencyen opened this issue Jan 31, 2023 · 1 comment

Comments

@wencyen
Copy link

wencyen commented Jan 31, 2023

Hello there,

I am looking for a way to pass in any react element in place of the overflow text. My use case is as follows

Given that a developer is using react-clamp-lines component
The developer should be able to pass int a custom prop `overFlowElement` that allows them to substitute the more / less text with any react element

In my case, I'd like to be able to substitute it with a link that says, "Continue reading .." and it should allow me to link from the text to a different page in my application. I don't believe this feature is currently supported by react-clamp-lines, does anyone have any suggestions for workarounds in the meantime? For reference, shittake has support for this feature and they call it overflowNode.

Thank you

@zoltantothcom
Copy link
Owner

@codepath2019 The easiest workaround would be:

  1. Set buttons={false} to hide them
  2. Create the Continue reading.. link below the component that points to a different page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants