Fix validate event (#338)

This commit is contained in:
Dong-hyeon Shin 2023-01-27 13:29:07 +09:00 committed by GitHub
parent a4ac2979c8
commit 1c20f4357c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,9 +157,10 @@ class Component(Base, ABC):
Raises:
ValueError: If the value is not a valid event chain.
"""
# If it's already an event chain, return it.
if isinstance(value, Var):
return value
# If it's a custom component and var, return it.
if isinstance(self, CustomComponent):
if isinstance(value, Var):
return value
arg = self.get_controlled_value()