stream-chat-react-native
stream-chat-react-native copied to clipboard
Add a prop that will trim whitespaces from text input value
Motivation I would like to request the addition of a custom prop that allows trimming whitespace from messages before they are sent. This feature will improve user experience by preventing messages from being sent accidentally with leading or trailing whitespace.
Proposed solution To address this, I propose adding a custom prop to the message input component that enables the trimming of whitespace. When this prop is enabled, any leading or trailing whitespace in the message input should be automatically removed before the message is sent.
1. Introduce a new boolean prop, e.g., trimWhitespace, to the message input component.
2. When trimWhitespace is set to true, the message input should automatically trim any leading and trailing whitespace from the message before sending.
3. Ensure that this functionality is optional and backward compatible, with the default behavior being false (no trimming).
<MessageInput
trimWhitespace={true}
/>
Acceptance Criteria A set of predefined requirements that must be met to mark a user story complete.