Skip to content

Commit 53bc6da

Browse files
committed
✨ feat(editarea): add lang attribute and spellcheck to the edit area
- add lang and spellCheck={true} props to the contenteditable div - strip region code from target_rfc (e.g. en-US → en) to match browser lang attribute format
1 parent e6460f0 commit 53bc6da

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

public/js/components/segments/Editarea.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ class Editarea extends React.Component {
726726
let readonly = false
727727

728728
if (this.props.segment) {
729-
lang = config.target_rfc.toLowerCase()
729+
lang = config.target_rfc.toLowerCase().split('-')[0]
730730
readonly =
731731
this.context.readonly ||
732732
this.context.locked ||
@@ -756,6 +756,8 @@ class Editarea extends React.Component {
756756
onDrop={onDragEnd}
757757
onFocus={onFocus}
758758
onKeyUp={onKeyUpEvent}
759+
lang={lang}
760+
spellCheck={true}
759761
>
760762
<Editor
761763
lang={lang}

0 commit comments

Comments
 (0)