Fix TextInput's is_persistent() flow

This commit is contained in:
yvqc 2023-06-04 13:50:56 +02:00 committed by GitHub
parent a9bd698683
commit 6b6cbc44ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -162,10 +162,10 @@ class BaseSelect(Item[V]):
@custom_id.setter @custom_id.setter
def custom_id(self, value: str) -> None: def custom_id(self, value: str) -> None:
if not isinstance(value, str): if not isinstance(value, str):
raise TypeError('custom_id must be None or str') raise TypeError('custom_id must be a str')
self._underlying.custom_id = value self._underlying.custom_id = value
self._provided_custom_id = value is not None self._provided_custom_id = True
@property @property
def placeholder(self) -> Optional[str]: def placeholder(self) -> Optional[str]:

View File

@ -137,9 +137,10 @@ class TextInput(Item[V]):
@custom_id.setter @custom_id.setter
def custom_id(self, value: str) -> None: def custom_id(self, value: str) -> None:
if not isinstance(value, str): if not isinstance(value, str):
raise TypeError('custom_id must be None or str') raise TypeError('custom_id must be a str')
self._underlying.custom_id = value self._underlying.custom_id = value
self._provided_custom_id = True
@property @property
def width(self) -> int: def width(self) -> int: