-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
While trying to fix some bugs in the MaskedInput, I discovered that typing a separator is expected to jump to the next separator, skipping over any empty positions.
For example, notice the jumps in the example below after typing a digit then a separator:
Example code
from textual.app import App, ComposeResult
from textual.widgets import MaskedInput
class MaskedInputApp(App):
def compose(self) -> ComposeResult:
yield MaskedInput(
template="9999-9999-9999-9999;_",
)
if __name__ == "__main__":
app = MaskedInputApp()
app.run()This behaviour doesn't appear to be documented anywhere (or covered in tests), but it seems to emulate masked inputs in Qt, which the Textual widget is based on.
The problem is that the current implementation will also delete any existing text when jumping to the next separator.
For example, pressing the right arrow then the separator key with existing text:
Unfortunately this looks like another bug in the MaskedInput, especially when compared to the Qt widget.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

