Refresh input when placeholder reactive is updated

This commit is contained in:
Darren Burns
2024-06-18 14:31:01 +01:00
parent 4f5a8ae64d
commit 6c480508ff

View File

@@ -176,7 +176,7 @@ class Input(Widget, can_focus=True):
input_scroll_offset = reactive(0)
cursor_position = reactive(0)
view_position = reactive(0)
placeholder = reactive("")
placeholder = reactive("", init=False)
complete = reactive("")
width = reactive(1)
_cursor_visible = reactive(True)
@@ -394,6 +394,9 @@ class Input(Widget, can_focus=True):
self._cursor_visible = True
self._blink_timer.pause()
def _watch_placeholder(self) -> None:
self.refresh()
@property
def cursor_screen_offset(self) -> Offset:
"""The offset of the cursor of this input in screen-space. (x, y)/(column, row)"""