Add support for new modal components

This commit is contained in:
Soheab
2026-02-22 22:43:06 +01:00
committed by GitHub
parent 05816daa7e
commit e5263c0870
10 changed files with 1169 additions and 51 deletions

View File

@@ -506,10 +506,8 @@ class Select(BaseSelect[V]):
@options.setter
def options(self, value: List[SelectOption]) -> None:
if not isinstance(value, list):
if not isinstance(value, list) or not all(isinstance(obj, SelectOption) for obj in value):
raise TypeError('options must be a list of SelectOption')
if not all(isinstance(obj, SelectOption) for obj in value):
raise TypeError('all list items must subclass SelectOption')
self._underlying.options = value
@@ -576,7 +574,7 @@ class Select(BaseSelect[V]):
"""
if len(self._underlying.options) >= 25:
raise ValueError('maximum number of options already provided')
raise ValueError('maximum number of options already provided (25)')
self._underlying.options.append(option)