-
Notifications
You must be signed in to change notification settings - Fork 625
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
Just like the screen recording I attached, only English data works fine. Once switched to Chinese data, the cursor position automatically jumps to the beginning, and it inputs both Pinyin and Chinese characters together. Python supports Chinese variables.
Code sample
Code
[import flet_code_editor as fce
import flet as ft
CODE = """# 1
# 2
# 3
import json
import textwrap
print("Folding demo")
"""
def main(page: ft.Page):
editor = fce.CodeEditor(
language=fce.CodeLanguage.PYTHON,
value=CODE,
selection=ft.TextSelection(base_offset=41, extent_offset=62),
autofocus=True,
expand=True,
on_selection_change=lambda e: print("Selection:", e),
)
async def fold_imports():
await editor.fold_imports()
async def fold_comment():
await editor.fold_comment_at_line_zero()
page.add(
ft.Row(
[
ft.Button("Fold imports", on_click=fold_imports),
ft.Button("Fold comment", on_click=fold_comment),
]
),
editor,
)
if __name__ == "__main__":
ft.run(main)]To reproduce
Just like the screen recording I attached, only English data works fine. Once switched to Chinese data, the cursor position automatically jumps to the beginning, and it inputs both Pinyin and Chinese characters together. Python supports Chinese variables.
Expected behavior
No response
Screenshots / Videos
Captures
QQ2026225-171352.mp4
Operating System
Windows
Operating system details
11
Flet version
0.81.0
Regression
No, it isn't
Suggestions
No response
Logs
Logs
[Paste your logs here]Additional details
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
🏗 In progress