reflex/reflex
Masen Furer ecb4dbaea9
[REF-2098] Allow overlay Close components to have on_click handlers (#2793)
* [REF-2098] Allow overlay Close components to have on_click handlers

The child of the Radix *Close components are passed `asChild`, meaning they are
treated as the direct child of the Close itself. This causes the `on_click`
handler attached to such an element to override the default `on_click` behavior
of the Close, which is to close the overlay, thus breaking the desired behavior
of the Close component.

When creating a Close component, if the child has an `on_click` handler, then
internally wrap it in a `Flex` so that the `Flex` gets the `asChild` treatment,
and both the default on_click and the child's on_click are both fired.

Bonus fix: pass `asChild` when constructing the `DrawerClose` to avoid a
<button> in <button> warning in the browser console, because the Drawer does
NOT pass `asChild` to the Close by default.

* Move Trigger logic to RadixThemesTriggerComponent base class

Apply trigger logic to Trigger, Close, Cancel, and Accept components; including
hover_card and dropdown_menu.
2024-03-06 17:09:46 -08:00
..
.templates fix template (#2787) 2024-03-05 16:10:44 -08:00
compiler app_module_for_backend: wait for _compile in prod mode (#2760) 2024-03-04 16:50:31 -08:00
components [REF-2098] Allow overlay Close components to have on_click handlers (#2793) 2024-03-06 17:09:46 -08:00
constants app_module_for_backend: wait for _compile in prod mode (#2760) 2024-03-04 16:50:31 -08:00
custom_components Add support for custom components starter (#2314) 2024-02-28 15:25:26 -08:00
middleware feat: Synchronizing localStorage between tabs using browser events (#2533) 2024-02-20 15:14:55 -08:00
utils Perf improvements (part 1) (#2779) 2024-03-06 10:42:20 -08:00
__init__.py Quick fixes for regressions in 0.4.0 (#2639) 2024-02-15 22:48:52 -08:00
__init__.pyi Quick fixes for regressions in 0.4.0 (#2639) 2024-02-15 22:48:52 -08:00
__main__.py add __main__ entry point to allow python -m reflex (#1516) 2023-08-03 14:26:50 -07:00
admin.py Allow view overrides for registering models with admin (#1249) 2023-06-27 14:08:09 -07:00
app_module_for_backend.py app_module_for_backend: wait for _compile in prod mode (#2760) 2024-03-04 16:50:31 -08:00
app.py pass lang and custom_attrs from app to html root (#2697) 2024-03-03 13:51:20 -08:00
app.pyi Refactor chakra components into separate folder (#2315) 2023-12-21 09:52:08 -08:00
base.py [REF-2045] Implement __reduce_ex__ for MutableProxy (#2688) 2024-02-22 10:14:14 -08:00
config.py Update deprecation version to 0.5.0 (#2642) 2024-02-16 11:23:15 -08:00
config.pyi Expose gunicorn_worker_class via Config (#2084) 2023-10-31 13:45:29 -07:00
event.py [REF-1885] Shard Substates when serializing to Redis (#2574) 2024-02-21 01:50:25 -08:00
model.py support SQLModel 0.0.14 + SQLAlchemy 2 (#2283) 2023-12-12 17:52:11 -08:00
page.py Update meta parameter to accept a list of any type (#2477) 2024-01-29 16:52:28 -08:00
page.pyi Lazy import modules in reflex (#2144) 2023-11-13 19:48:12 -08:00
reflex.py app_module_for_backend: wait for _compile in prod mode (#2760) 2024-03-04 16:50:31 -08:00
route.py [REF-1741] Disallow routes with /api prefix (#2711) 2024-02-26 19:34:51 -08:00
state.py Fix infinite recursion when a substate named "state" has a computed var (#2778) 2024-03-04 13:13:08 -08:00
style.py [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
testing.py [REF-1988] API to Get instance of Arbitrary State class (#2678) 2024-02-27 13:02:08 -08:00
vars.py Perf improvements (part 1) (#2779) 2024-03-06 10:42:20 -08:00
vars.pyi Initial values for computed vars (#2670) 2024-02-24 13:45:07 -08:00