@team-monolith/cds 1.9.7 → 1.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,30 +38,19 @@ export function InputComponent(props) {
38
38
  return (_jsx(Input, { size: "small", placeholder: placeholder || "여기에 입력하세요.", value: answerInput, color: "default", fullWidth: true, inputProps: { readOnly: true } }));
39
39
  }
40
40
  else {
41
- return (_jsx(Input, { size: "small", placeholder: placeholder || "여기에 입력하세요.", value: answerInput, onChange: (e) => setAnswerInput(e.target.value),
42
- // 한글 입력시에 onChange마다 update가 일어나는 것을 방지하기 위해 입력 완료후 onBlur시에 update하는 전략을 사용합니다.
43
- // 이를 위해 answerInput을 state로 관리합니다.
44
- inputProps: {
45
- onBlur: (_e) => {
46
- editor.update(() => {
47
- const node = $getNodeByKey(nodeKey);
48
- if (!$isProblemInputNode(node)) {
49
- return;
50
- }
51
- node.setAnswer(answerInput);
52
- });
53
- },
54
- onKeyPress: (e) => {
55
- if (e.key === "Enter") {
56
- editor.update(() => {
57
- const node = $getNodeByKey(nodeKey);
58
- if (!$isProblemInputNode(node)) {
59
- return;
60
- }
61
- node.setAnswer(answerInput);
62
- });
41
+ return (_jsx(Input, { size: "small", placeholder: placeholder || "여기에 입력하세요.", value: answerInput, onChange: (e) => {
42
+ // SoT를 EditorState로 설정하는 경우 한글 입력시 문제가 생김.
43
+ // ex) "나비" 입력시 -> "ㄴ나납ㅂ비"
44
+ // SoT를 내부 State로 관리하고 EditorState를 따로 설정.
45
+ // 문제를 파악하고 추후 개선 필요.
46
+ setAnswerInput(e.target.value);
47
+ editor.update(() => {
48
+ const node = $getNodeByKey(nodeKey);
49
+ if (!$isProblemInputNode(node)) {
50
+ return;
63
51
  }
64
- },
52
+ node.setAnswer(e.target.value);
53
+ });
65
54
  }, color: "default", fullWidth: true }));
66
55
  }
67
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.9.7",
3
+ "version": "1.9.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,