Skip to content

Conversation

@DevAmar1996
Copy link

Description
This pull request introduces a new feature to the ExpandableText component: users can collapse the expanded text by clicking a "Show Less" button.

Key Changes:

  1. Show Less Button:
  • I added a lessButtonText property, which displays as "Show Less" when the text is expanded.
  • The button toggles between "Show More" (collapsed state) and "Show Less" (expanded state).
  1. Improved Button Logic:
  • Refined logic to determine button visibility through shouldShowMoreButton and shouldShowLessButton.
  • The button text dynamically updates based on isExpanded, with animations applied during state transitions.

Additional Details:

  • Updated animations apply when toggling between expanded and collapsed states.
  • Maintained backward compatibility, so existing functionality is unaffected if collapseEnabled is not used.

These changes provide more flexibility and control for the ExpandableText component, especially in scenarios where users may need to collapse content to save space on the screen.

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.

2 participants