Commit 79f1f5ac by HoMeTown

fix: 解决输入框复制有样式的问题

parent cbf58826
......@@ -67,6 +67,11 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
const handleCloseLoginModal = () => {
isOpenLoginModalActions.setLeft()
}
const handlePaste = (event: React.ClipboardEvent<HTMLDivElement>) => {
event.preventDefault()
const text = event.clipboardData.getData('text/plain')
document.execCommand('insertText', false, text)
}
useEffect(() => {
startAnimation()
......@@ -92,6 +97,7 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
onInput={handleInput}
onFocus={onFocus}
onKeyDown={handleKeyDown}
onPaste={handlePaste}
suppressContentEditableWarning={true}
style={{
resize: 'none',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment