feat: add multi line support for chatbox

pull/90/head
moonrailgun 2 years ago
parent 2d01f7cb84
commit 7b176141be

@ -1,5 +1,5 @@
.chatbox-mention-input {
@apply shadow-none border-0 px-4 py-2;
@apply shadow-none border-0 px-4 py-2 relative;
&__control {
@apply relative;

@ -8,6 +8,18 @@ import { useChatInputMentionsContext } from './context';
import { MentionCommandItem } from './MentionCommandItem';
import './input.less';
const defaultChatInputBoxInputStyle = {
input: {
overflow: 'auto',
maxHeight: 70,
},
highlighter: {
boxSizing: 'border-box',
overflow: 'hidden',
maxHeight: 70,
},
};
interface ChatInputBoxInputProps
extends Omit<
React.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement>,
@ -28,7 +40,7 @@ export const ChatInputBoxInput: React.FC<ChatInputBoxInputProps> = React.memo(
className="chatbox-mention-input"
placeholder={placeholder ?? t('输入一些什么')}
disabled={disabled}
singleLine={true}
style={defaultChatInputBoxInputStyle}
maxLength={1000}
value={props.value}
onChange={(e, newValue, _, mentions) =>

Loading…
Cancel
Save