Skip to content

Commit 8049735

Browse files
committed
fix re issues found by masen
1 parent 88a7226 commit 8049735

4 files changed

Lines changed: 34 additions & 13 deletions

File tree

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"reflex/components/core/clipboard.pyi": "c8a7834ea5f6202c760065b2534ea59d",
1818
"reflex/components/core/debounce.pyi": "1722c092d6e17406a9bf047353d05ea6",
1919
"reflex/components/core/helmet.pyi": "cb5ac1be02c6f82fcc78ba74651be593",
20-
"reflex/components/core/html.pyi": "8582c9007e412b67be807806b73b542e",
20+
"reflex/components/core/html.pyi": "4ebe946f3fc097fc2e31dddf7040ec1c",
2121
"reflex/components/core/sticky.pyi": "cb763b986a9b0654d1a3f33440dfcf60",
2222
"reflex/components/core/upload.pyi": "c90782be1b63276b428bce3fd4ce0af2",
2323
"reflex/components/core/window_events.pyi": "e7af4bf5341c4afaf60c4a534660f68f",

reflex/components/core/html.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""A html component."""
22

3+
from reflex.components.component import field
34
from reflex.components.el.elements.typography import Div
45
from reflex.vars.base import Var
56

@@ -11,7 +12,7 @@ class Html(Div):
1112
The code to render the html component.
1213
"""
1314

14-
dangerouslySetInnerHTML: Var[dict[str, str]] # noqa: N815 = field(doc="The HTML to render.")
15+
dangerouslySetInnerHTML: Var[dict[str, str]] = field(doc="The HTML to render.") # noqa: N815
1516

1617
@classmethod
1718
def create(cls, *children, **props):

reflex/components/core/window_events.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,33 @@ def _on_storage_spec(e: ObjectVar) -> tuple[Var[str], Var[str], Var[str], Var[st
5555
class WindowEventListener(Fragment):
5656
"""A component that listens for window events."""
5757

58-
on_resize: rx.EventHandler[_on_resize_spec] = field(doc="Event handlers")
59-
on_scroll: rx.EventHandler[_on_scroll_spec]
60-
on_focus: rx.EventHandler[no_args_event_spec]
61-
on_blur: rx.EventHandler[no_args_event_spec]
62-
on_visibility_change: rx.EventHandler[_on_visibility_change_spec]
63-
on_before_unload: rx.EventHandler[no_args_event_spec]
64-
on_key_down: rx.EventHandler[key_event]
65-
on_popstate: rx.EventHandler[no_args_event_spec]
66-
on_storage: rx.EventHandler[_on_storage_spec]
58+
on_resize: rx.EventHandler[_on_resize_spec] = field(
59+
doc="Triggered when the browser window is resized. Receives the new width and height in pixels."
60+
)
61+
on_scroll: rx.EventHandler[_on_scroll_spec] = field(
62+
doc="Triggered when the user scrolls the page. Receives the current horizontal and vertical scroll positions."
63+
)
64+
on_focus: rx.EventHandler[no_args_event_spec] = field(
65+
doc="Triggered when the browser tab or window gains focus (e.g. user switches back to the tab)."
66+
)
67+
on_blur: rx.EventHandler[no_args_event_spec] = field(
68+
doc="Triggered when the browser tab or window loses focus (e.g. user switches to another tab)."
69+
)
70+
on_visibility_change: rx.EventHandler[_on_visibility_change_spec] = field(
71+
doc="Triggered when the page becomes visible or hidden (e.g. tab switch or minimize). Receives a boolean indicating whether the document is hidden."
72+
)
73+
on_before_unload: rx.EventHandler[no_args_event_spec] = field(
74+
doc="Triggered just before the user navigates away from or closes the page. Useful for cleanup or prompting unsaved-changes warnings."
75+
)
76+
on_key_down: rx.EventHandler[key_event] = field(
77+
doc="Triggered when a key is pressed anywhere on the page. Receives the key name and active modifier keys (shift, ctrl, alt, meta)."
78+
)
79+
on_popstate: rx.EventHandler[no_args_event_spec] = field(
80+
doc="Triggered when the user navigates back or forward via the browser history buttons."
81+
)
82+
on_storage: rx.EventHandler[_on_storage_spec] = field(
83+
doc="Triggered when localStorage or sessionStorage is modified in another tab. Receives the key, old value, new value, and the URL of the document that changed the storage."
84+
)
6785

6886
hooks: list[str] = field(default_factory=list, is_javascript_property=False)
6987

reflex/components/datadisplay/dataeditor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,11 @@ class DataEditor(NoSSRComponent):
257257

258258
smooth_scroll_y: Var[bool] = field(doc="Enable vertical smooth scrolling.")
259259

260-
vertical_border: Var[
260+
vertical_border: Var[ # TODO: support a mapping (dict[int, bool])
261261
bool
262-
] # TODO: support a mapping (dict[int, bool]) = field(doc="Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders.")
262+
] = field(
263+
doc="Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders."
264+
)
263265

264266
column_select: Var[Literal["none", "single", "multi"]] = field(
265267
doc='Allow columns selections. ("none", "single", "multi")'

0 commit comments

Comments
 (0)