Mobile: Fixes #6175: Enable autocorrect with spellcheck (#7532)

pull/7560/head
Henry Heino 2022-12-30 15:20:56 -08:00 committed by GitHub
parent e09b26b99b
commit ea30a6bd38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -309,6 +309,7 @@ export function initCodeMirror(
EditorView.lineWrapping,
EditorView.contentAttributes.of({
autocapitalize: 'sentence',
autocorrect: settings.spellcheckEnabled ? 'true' : 'false',
spellcheck: settings.spellcheckEnabled ? 'true' : 'false',
}),
EditorView.updateListener.of((viewUpdate: ViewUpdate) => {

View File

@ -18,24 +18,26 @@ const regionStopDecoration = Decoration.line({
attributes: { class: 'cm-regionLastLine' },
});
const noSpellCheckAttrs = { spellcheck: 'false', autocorrect: 'false' };
const codeBlockDecoration = Decoration.line({
attributes: { class: 'cm-codeBlock', spellcheck: 'false' },
attributes: { class: 'cm-codeBlock', ...noSpellCheckAttrs },
});
const inlineCodeDecoration = Decoration.mark({
attributes: { class: 'cm-inlineCode', spellcheck: 'false' },
attributes: { class: 'cm-inlineCode', ...noSpellCheckAttrs },
});
const mathBlockDecoration = Decoration.line({
attributes: { class: 'cm-mathBlock', spellcheck: 'false' },
attributes: { class: 'cm-mathBlock', ...noSpellCheckAttrs },
});
const inlineMathDecoration = Decoration.mark({
attributes: { class: 'cm-inlineMath', spellcheck: 'false' },
attributes: { class: 'cm-inlineMath', ...noSpellCheckAttrs },
});
const urlDecoration = Decoration.mark({
attributes: { class: 'cm-url', spellcheck: 'false' },
attributes: { class: 'cm-url', ...noSpellCheckAttrs },
});
const blockQuoteDecoration = Decoration.line({