feat(chat): set CHAR_LIMIT for chat input

pull/14968/head
Calin-Teodor 10 months ago committed by Calinteodor
parent 3066fc1d31
commit 68106feb57
  1. 3
      react/features/chat/components/native/ChatInputBar.tsx
  2. 2
      react/features/chat/components/web/ChatInput.tsx
  3. 2
      react/features/chat/constants.ts

@ -11,6 +11,8 @@ import IconButton from '../../../base/ui/components/native/IconButton';
import Input from '../../../base/ui/components/native/Input';
import { BUTTON_TYPES } from '../../../base/ui/constants.native';
import { CHAR_LIMIT } from '../../constants';
import styles from './styles';
@ -91,6 +93,7 @@ class ChatInputBar extends Component<IProps, IState> {
<Input
blurOnSubmit = { false }
customStyles = {{ container: styles.customInputContainer }}
maxLength = { CHAR_LIMIT }
multiline = { false }
onBlur = { this._onFocused(false) }
onChange = { this._onChangeText }

@ -8,6 +8,7 @@ import { translate } from '../../../base/i18n/functions';
import { IconFaceSmile, IconSend } from '../../../base/icons/svg';
import Button from '../../../base/ui/components/web/Button';
import Input from '../../../base/ui/components/web/Input';
import { CHAR_LIMIT } from '../../constants';
import { areSmileysDisabled } from '../../functions';
import SmileysPanel from './SmileysPanel';
@ -137,6 +138,7 @@ class ChatInput extends Component<IProps, IState> {
iconClick = { this._toggleSmileysPanel }
id = 'chat-input-messagebox'
maxRows = { 5 }
maxLength = { CHAR_LIMIT }
onChange = { this._onMessageChange }
onKeyPress = { this._onDetectSubmit }
placeholder = { this.props.t('chat.messagebox') }

@ -48,3 +48,5 @@ export const TIMESTAMP_FORMAT = 'H:mm';
* The namespace for system messages.
*/
export const MESSAGE_TYPE_SYSTEM = 'system_chat_message';
export const CHAR_LIMIT = 500;

Loading…
Cancel
Save