From dfc039601f7b4d74592dfe39c31b67c0f0619bca Mon Sep 17 00:00:00 2001 From: Nicolas DUBIEN Date: Thu, 27 May 2021 04:27:41 +0200 Subject: [PATCH] Fix warnings related to `autoCorrect` and `autoCapitalize` (#4295) Related to https://github.com/ianstormtaylor/slate/issues/4248 --- .changeset/metal-suits-reply.md | 5 +++++ packages/slate-react/src/components/editable.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/metal-suits-reply.md diff --git a/.changeset/metal-suits-reply.md b/.changeset/metal-suits-reply.md new file mode 100644 index 000000000..f2018a690 --- /dev/null +++ b/.changeset/metal-suits-reply.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Fix React warnings related to `autoCorrect` and `autoCapitalize` attributes being passed as a boolean instead of a string. diff --git a/packages/slate-react/src/components/editable.tsx b/packages/slate-react/src/components/editable.tsx index 5c4ef4613..7c0582ee2 100644 --- a/packages/slate-react/src/components/editable.tsx +++ b/packages/slate-react/src/components/editable.tsx @@ -507,10 +507,10 @@ export const Editable = (props: EditableProps) => { // have to use hacks to make these replacement-based features work. spellCheck={!HAS_BEFORE_INPUT_SUPPORT ? false : attributes.spellCheck} autoCorrect={ - !HAS_BEFORE_INPUT_SUPPORT ? false : attributes.autoCorrect + !HAS_BEFORE_INPUT_SUPPORT ? 'false' : attributes.autoCorrect } autoCapitalize={ - !HAS_BEFORE_INPUT_SUPPORT ? false : attributes.autoCapitalize + !HAS_BEFORE_INPUT_SUPPORT ? 'false' : attributes.autoCapitalize } data-slate-editor data-slate-node="value"