From fc180fc2d908bf80765437df6a5b590cb5d0bf29 Mon Sep 17 00:00:00 2001 From: MahekkumarChaniyara Date: Wed, 27 May 2026 19:15:23 +0530 Subject: [PATCH] fix/disable-translate-on-editor --- src/index.tsx | 2 ++ test/index.js | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index f83a11db..313fea6b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -330,6 +330,8 @@ class ReactQuill extends React.Component { */ createEditor(element: Element, config: QuillOptions) { const editor = new Quill(element, config); + // Prevent browser auto-translation from mutating editor contents while typing. + editor.root.setAttribute('translate', 'no'); if (config.tabIndex != null) { this.setEditorTabIndex(editor, config.tabIndex); } diff --git a/test/index.js b/test/index.js index 5bb1cafe..a0f57d5c 100644 --- a/test/index.js +++ b/test/index.js @@ -50,6 +50,12 @@ describe('', function() { expect(quill instanceof Quill).to.equal(true); }); + it('disables browser translation on the editable root', () => { + const wrapper = mountReactQuill(); + const quill = getQuillInstance(wrapper); + expect(quill.root.getAttribute('translate')).to.equal('no'); + }); + it('passes options to Quill from props', () => { const enabledFormats = ['underline', 'bold', 'italic']; const props = {