Open
Description
Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed
Yes, no issue mentioned problems with MaskedInput validation.
Have you checked against the most recent version of Textual? https://pypi.org/search/?q=textual
Yes
Please give a brief but clear explanation of the issue. If you can, include a complete working example that demonstrates the bug. Check it can run without modifications.
- Run the app
uv run --script masked_input_value_error.py
- Press the key
e
or any other non digit. - Watch the app crash with a ValueError.
masked_input_value_error.py
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "textual==1.0.0",
# ]
# ///
from textual.app import App, ComposeResult
from textual.widgets import MaskedInput
class BugApp(App[None]):
def compose(self) -> ComposeResult:
yield MaskedInput("9", "9")
app = BugApp()
app.run()
It will be helpful if you run the following command and paste the results:
textual diagnose
If you don't have the textual
command on your path, you may have forgotten to install the textual-dev
package.
Feel free to add screenshots and / or videos. These can be very helpful!
Screencast.from.2025-01-24.22-33-57.mp4
Textual Diagnostics
Versions
Name | Value |
---|---|
Textual | 1.0.0 |
Rich | 13.9.4 |
Python
Name | Value |
---|---|
Version | 3.13.0 |
Implementation | CPython |
Compiler | Clang 18.1.8 |
Executable | /home/jonathan/.cache/uv/archive-v0/uhCuU97F8DMiIyfN6OiqV/bin/python |
Operating System
Name | Value |
---|---|
System | Linux |
Release | 6.12.9-100.fc40.x86_64 |
Version | #1 SMP PREEMPT_DYNAMIC Thu Jan 9 16:04:00 UTC 2025 |
Terminal
Name | Value |
---|---|
Terminal Application | vscode (1.96.4) |
TERM | xterm-256color |
COLORTERM | truecolor |
FORCE_COLOR | Not set |
NO_COLOR | Not set |
Rich Console options
Name | Value |
---|---|
size | width=142, height=23 |
legacy_windows | False |
min_width | 1 |
max_width | 142 |
is_terminal | True |
encoding | utf-8 |
max_height | 23 |
justify | None |
overflow | None |
no_wrap | False |
highlight | None |
markup | None |
height | None |
Metadata
Metadata
Assignees
Labels
No labels