From e5ad30a25be77aae17b277dc0a8f64b3ff67e563 Mon Sep 17 00:00:00 2001 From: Xander Dumaine Date: Wed, 9 Oct 2024 19:29:20 -0400 Subject: [PATCH] feat: plaintext-only message input --- src/components/ContentEditable/ContentEditable.jsx | 13 +++++++++++-- src/components/MessageInput/MessageInput.d.ts | 1 + src/components/MessageInput/MessageInput.jsx | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/ContentEditable/ContentEditable.jsx b/src/components/ContentEditable/ContentEditable.jsx index 5bd7c07..ea53462 100644 --- a/src/components/ContentEditable/ContentEditable.jsx +++ b/src/components/ContentEditable/ContentEditable.jsx @@ -113,15 +113,18 @@ export class ContentEditable extends Component { handleInput, handleKeyPress, innerHTML, - props: { placeholder, disabled, className }, + props: { placeholder, disabled, className, plaintextOnly }, } = this, ph = typeof placeholder === "string" ? placeholder : ""; + const enabledContentEditable = plaintextOnly ? "plaintext-only" : true; + const contentEditable = disabled === false ? enabledContentEditable : false; + return (