Skip to content

Commit

Permalink
bug-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
umangutkarsh committed Feb 18, 2024
1 parent 0e9bb43 commit 4e725f5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/react/src/components/ChatInput/ChatInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ const ChatInput = ({ scrollToBottom }) => {
};

const sendMessage = async () => {
scrollToBottom();
messageRef.current.style.height = '44px';
const message = messageRef.current.value.trim();
if (!message.length || !isUserAuthenticated) {
Expand Down Expand Up @@ -210,6 +209,8 @@ const ChatInput = ({ scrollToBottom }) => {
setDisableButton(true);
setEditMessage({});
}

scrollToBottom();
};

const sendAttachment = (event) => {
Expand Down Expand Up @@ -278,11 +279,18 @@ const ChatInput = ({ scrollToBottom }) => {
const handleMemberClick = (selectedItem) => {
setshowMembersList(false);

console.log(messageRef.current.value);
let insertionText;
if (selectedItem === 'all') {
insertionText = `@all `;
insertionText = `${messageRef.current.value.substring(
0,
messageRef.current.value.lastIndexOf('@')
)}@all `;
} else if (selectedItem === 'here') {
insertionText = `@here `;
insertionText = `${messageRef.current.value.substring(
0,
messageRef.current.value.lastIndexOf('@')
)}@here `;
} else {
insertionText = `${messageRef.current.value.substring(
0,
Expand Down

0 comments on commit 4e725f5

Please sign in to comment.