mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
Add spellcheck for codemirror text editors
This commit is contained in:
parent
70286353c5
commit
2f98ae90ff
|
@ -100,7 +100,12 @@ const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
|||
);
|
||||
|
||||
const editorExtensions = useMemo(
|
||||
() => [EditorView.lineWrapping, NaturalLanguage, refsHoverTooltip(schema?.items || [], colors)],
|
||||
() => [
|
||||
EditorView.lineWrapping,
|
||||
EditorView.contentAttributes.of({ spellcheck: 'true' }),
|
||||
NaturalLanguage,
|
||||
refsHoverTooltip(schema?.items || [], colors)
|
||||
],
|
||||
[schema?.items, colors]
|
||||
);
|
||||
|
||||
|
@ -194,7 +199,6 @@ const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
|||
onKeyDown={handleInput}
|
||||
onFocus={handleFocusIn}
|
||||
onBlur={handleFocusOut}
|
||||
// spellCheck= // TODO: figure out while automatic spellcheck doesn't work or implement with extension
|
||||
{...restProps}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -4,13 +4,13 @@ import { hoverTooltip } from '@codemirror/view';
|
|||
|
||||
import { parseEntityReference, parseSyntacticReference } from '@/models/languageAPI';
|
||||
import { IConstituenta } from '@/models/rsform';
|
||||
import { IColorTheme } from '@/styling/color';
|
||||
import {
|
||||
domTooltipEntityReference,
|
||||
domTooltipSyntacticReference,
|
||||
findContainedNodes,
|
||||
findEnvelopingNodes
|
||||
} from '@/utils/codemirror';
|
||||
import { IColorTheme } from '@/styling/color';
|
||||
|
||||
import { ReferenceTokens } from './parse';
|
||||
import { RefEntity, RefSyntactic } from './parse/parser.terms';
|
||||
|
|
Loading…
Reference in New Issue
Block a user