Skip to content

Commit 56734fe

Browse files
authored
Merge pull request #2 from Danmou/fix/unicode_support
Allow unicode text input
2 parents a697304 + 3717d16 commit 56734fe

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/textual_inputs/text_input.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Simple text input
33
"""
4-
import string
54
from typing import Any, List, Optional, Tuple, Union
65

76
import rich.box
@@ -240,7 +239,7 @@ async def on_key(self, event: events.Key) -> None:
240239
)
241240
await self._emit_on_change(event)
242241

243-
elif event.key in string.printable:
242+
elif len(event.key) == 1 and event.key.isprintable():
244243
if self._cursor_position == 0:
245244
self.value = event.key + self.value
246245
elif self._cursor_position == len(self.value):

0 commit comments

Comments
 (0)