Răsfoiți Sursa

[REF-2586] Pass child event_trigger through DebounceInput (#3092)

Masen Furer 1 an în urmă
părinte
comite
a84bc1e04f
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      reflex/components/core/debounce.py

+ 4 - 1
reflex/components/core/debounce.py

@@ -79,7 +79,9 @@ class DebounceInput(Component):
             for p in cls.get_props()
             if getattr(child, p, None) is not None
         }
-        props_from_child.update(child.event_triggers)
+        props[EventTriggers.ON_CHANGE] = child.event_triggers.pop(
+            EventTriggers.ON_CHANGE
+        )
         props = {**props_from_child, **props}
 
         # Carry all other child props directly via custom_attrs
@@ -117,6 +119,7 @@ class DebounceInput(Component):
 
         component = super().create(**props)
         component._get_style = child._get_style
+        component.event_triggers.update(child.event_triggers)
         return component
 
     def get_event_triggers(self) -> dict[str, Any]: