|
@@ -10,7 +10,9 @@ from .elements.mixins.content_element import ContentElement
|
|
from .elements.mixins.source_element import SourceElement
|
|
from .elements.mixins.source_element import SourceElement
|
|
from .elements.mixins.text_element import TextElement
|
|
from .elements.mixins.text_element import TextElement
|
|
from .elements.notification import Notification
|
|
from .elements.notification import Notification
|
|
|
|
+from .elements.radio import Radio
|
|
from .elements.select import Select
|
|
from .elements.select import Select
|
|
|
|
+from .elements.toggle import Toggle
|
|
|
|
|
|
T = TypeVar('T', bound=Element)
|
|
T = TypeVar('T', bound=Element)
|
|
|
|
|
|
@@ -116,10 +118,10 @@ class ElementFilter(Generic[T]):
|
|
) if content]
|
|
) if content]
|
|
if isinstance(element, Notification):
|
|
if isinstance(element, Notification):
|
|
element_contents.append(element.message)
|
|
element_contents.append(element.message)
|
|
- if isinstance(element, Select):
|
|
|
|
|
|
+ if isinstance(element, (Select, Radio, Toggle)):
|
|
options = {option['value']: option['label'] for option in element.props.get('options', [])}
|
|
options = {option['value']: option['label'] for option in element.props.get('options', [])}
|
|
element_contents.append(options.get(element.value, ''))
|
|
element_contents.append(options.get(element.value, ''))
|
|
- if element.is_showing_popup:
|
|
|
|
|
|
+ if not isinstance(element, Select) or element.is_showing_popup:
|
|
element_contents.extend(options.values())
|
|
element_contents.extend(options.values())
|
|
if any(all(needle not in str(haystack) for haystack in element_contents) for needle in self._contents):
|
|
if any(all(needle not in str(haystack) for haystack in element_contents) for needle in self._contents):
|
|
continue
|
|
continue
|