Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
krittick committed Feb 28, 2022
1 parent 6587861 commit fc86937
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions discord/ui/input_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
required=required,
value=value,
)
self._input_value = None
self._input_value = False
self.row = row
self._rendered_row: Optional[int] = None

Expand Down Expand Up @@ -164,7 +164,10 @@ def required(self, value: Optional[bool]):
@property
def value(self) -> Optional[str]:
"""Optional[:class:`str`]: The value entered in the text field."""
return self._input_value or self._underlying.value
if self._input_value is not False:
# only False on init, otherwise the value was either set or cleared
return self._input_value # type: ignore
return self._underlying.value

@value.setter
def value(self, value: Optional[str]):
Expand Down

0 comments on commit fc86937

Please sign in to comment.