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(
|
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]
|
[schema?.items, colors]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -194,7 +199,6 @@ const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
||||||
onKeyDown={handleInput}
|
onKeyDown={handleInput}
|
||||||
onFocus={handleFocusIn}
|
onFocus={handleFocusIn}
|
||||||
onBlur={handleFocusOut}
|
onBlur={handleFocusOut}
|
||||||
// spellCheck= // TODO: figure out while automatic spellcheck doesn't work or implement with extension
|
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,13 +4,13 @@ import { hoverTooltip } from '@codemirror/view';
|
||||||
|
|
||||||
import { parseEntityReference, parseSyntacticReference } from '@/models/languageAPI';
|
import { parseEntityReference, parseSyntacticReference } from '@/models/languageAPI';
|
||||||
import { IConstituenta } from '@/models/rsform';
|
import { IConstituenta } from '@/models/rsform';
|
||||||
|
import { IColorTheme } from '@/styling/color';
|
||||||
import {
|
import {
|
||||||
domTooltipEntityReference,
|
domTooltipEntityReference,
|
||||||
domTooltipSyntacticReference,
|
domTooltipSyntacticReference,
|
||||||
findContainedNodes,
|
findContainedNodes,
|
||||||
findEnvelopingNodes
|
findEnvelopingNodes
|
||||||
} from '@/utils/codemirror';
|
} from '@/utils/codemirror';
|
||||||
import { IColorTheme } from '@/styling/color';
|
|
||||||
|
|
||||||
import { ReferenceTokens } from './parse';
|
import { ReferenceTokens } from './parse';
|
||||||
import { RefEntity, RefSyntactic } from './parse/parser.terms';
|
import { RefEntity, RefSyntactic } from './parse/parser.terms';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user