We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a0217c commit 5be788fCopy full SHA for 5be788f
src/components/IMEField.tsx
@@ -0,0 +1,29 @@
1
+import * as wanakana from "wanakana";
2
+import { createSignal, onMount } from "solid-js";
3
+
4
+import { TextField, TextFieldTextArea } from "./ui/TextField";
5
6
+export function IMEField() {
7
+ const [input, setInput] = createSignal("");
8
9
+ let textArea: HTMLTextAreaElement | undefined;
10
11
+ onMount(() => {
12
+ if (!textArea) {
13
+ console.error("TextArea not found, could not bind wanakana");
14
+ return;
15
+ }
16
+ wanakana.bind(textArea);
17
+ });
18
19
+ return (
20
+ <TextField class="w-full">
21
+ <TextFieldTextArea
22
+ autoResize
23
+ placeholder="Type your Japanese message here"
24
+ ref={textArea}
25
+ onInput={(e) => setInput(e.currentTarget.value)}
26
+ />
27
+ </TextField>
28
+ );
29
+}
0 commit comments