Skip to content

Commit 50280b4

Browse files
pvcravenPaul V Craveneruvanos
authored
Fix caret behavior on input field activation (#2850)
* Fix caret behavior on input field activation * gui: use private property to stay consistent --------- Co-authored-by: Paul V Craven <paul.craven@optimizley.com> Co-authored-by: Maic Siemering <maic@siemering.tech>
1 parent 209f887 commit 50280b4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

arcade/gui/widgets/text.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,13 +584,17 @@ def __init__(
584584
def _on_focus_change(self):
585585
if self.focused:
586586
self.activate()
587-
elif self.active:
587+
elif self._active:
588588
self.deactivate()
589589

590590
def _on_active_changed(self):
591591
"""Handle the active state change of the input
592592
text field to care about loosing active state."""
593-
if not self._active:
593+
if self._active:
594+
self.trigger_full_render()
595+
self.caret.on_activate()
596+
self.caret.position = len(self.doc.text)
597+
else:
594598
self.deactivate()
595599

596600
def _apply_style(self):

0 commit comments

Comments
 (0)