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

added ability to change or remove the ... at the end with a custom component #31

Merged
merged 2 commits into from
Jul 25, 2021

Conversation

vasilevich
Copy link

Hello, Thank you for taking the time to make this module. well done.
I needed to change the "..." dots at the end of the truncated text so I implemented the prop truncatedEndingComponent which defaults to the original "...".
if you want,
feel free to use this as an example, or merge as you wish.

hope this helps.

@antares-code antares-code self-assigned this Jul 25, 2021
@antares-code antares-code merged commit 8f188a7 into devzonetech:master Jul 25, 2021
@centinel3
Copy link

Thank you for this feature addition. Can you update the type as well for this? Getting a type error when I try to use this

truncatedEndingComponent is not present in the interface

export interface ReactShowMoreTextProps {
anchorClass?: string | undefined;
children?: React.ReactNode | undefined;
className?: string | undefined;
expanded?: boolean | undefined;
keepNewLines?: boolean | undefined;
less?: React.ReactNode | undefined;
lines?: number | undefined;
more?: React.ReactNode | undefined;
onClick?: ((expanded: boolean) => void) | undefined;
width?: number | undefined;
}

vasilevich added a commit to vasilevich/DefinitelyTyped that referenced this pull request Oct 6, 2021
Added truncatedEndingComponent
in accordance with  this commit : 
devzonetech/react-show-more-text#31

Thank you
@vasilevich
Copy link
Author

Hello @centinel3 , I have opened this pull request :
DefinitelyTyped/DefinitelyTyped#56238
I hope it goes well.
Thanks.

@centinel3
Copy link

approved. Thank you!

typescript-bot pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Oct 6, 2021
…silevich

* Update index.d.ts

Added truncatedEndingComponent
in accordance with  this commit : 
devzonetech/react-show-more-text#31

Thank you

* Update react-show-more-text-tests.tsx

added example test to test truncatedEndingComponent
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

Successfully merging this pull request may close these issues.

3 participants