mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #911 from davep/input-password-arg
Add password as a Input keyword argument - see https://github.com/Textualize/textual/discussions/905 for some context
This commit is contained in:
@@ -107,6 +107,7 @@ class Input(Widget, can_focus=True):
|
|||||||
value: str = "",
|
value: str = "",
|
||||||
placeholder: str = "",
|
placeholder: str = "",
|
||||||
highlighter: Highlighter | None = None,
|
highlighter: Highlighter | None = None,
|
||||||
|
password: bool = False,
|
||||||
name: str | None = None,
|
name: str | None = None,
|
||||||
id: str | None = None,
|
id: str | None = None,
|
||||||
classes: str | None = None,
|
classes: str | None = None,
|
||||||
@@ -115,6 +116,7 @@ class Input(Widget, can_focus=True):
|
|||||||
self.value = value
|
self.value = value
|
||||||
self.placeholder = placeholder
|
self.placeholder = placeholder
|
||||||
self.highlighter = highlighter
|
self.highlighter = highlighter
|
||||||
|
self.password = password
|
||||||
|
|
||||||
def _position_to_cell(self, position: int) -> int:
|
def _position_to_cell(self, position: int) -> int:
|
||||||
"""Convert an index within the value to cell position."""
|
"""Convert an index within the value to cell position."""
|
||||||
|
|||||||
Reference in New Issue
Block a user