Skip to content

Commit

Permalink
Refresh input when placeholder reactive is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Jun 18, 2024
1 parent 4f5a8ae commit 6c48050
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/textual/widgets/_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -394,6 +394,9 @@ def _watch_cursor_blink(self, blink: bool) -> None:
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)"""
Expand Down

0 comments on commit 6c48050

Please sign in to comment.