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:
Dave Pearson
2022-10-14 18:48:11 +01:00
committed by GitHub

View File

@@ -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."""