ratatui-org / ratatui

Rust library that's all about cooking up terminal user interfaces (TUIs) 👨‍🍳🐀
https://ratatui.rs
MIT License
8.96k stars 274 forks source link

User Input example doesn't work with UTF-8 characters #1068

Closed OkieOth closed 2 months ago

OkieOth commented 2 months ago

Description

If I am running the user_input example, then the application paniced when I am using e.g. 'ä' or other UTF-8 characters as input.

To Reproduce

Run cargo run --example=user_input --features=crossterm Enter in the input field multiple times an 'ä' (or similar)

Expected behavior

Application should somehow not crash

Environment

Solution

The old example doesn't handle the use vector of String by chars. Instead the operations were based on bytes.

I will provide a PR that fixes that issue.

OkieOth commented 2 months ago

PR is there ... be kind is my first one x-D