Skip to content

Commit

Permalink
Fixed inconsistent behavior of TextInput bubble and handles
Browse files Browse the repository at this point in the history
The entirety of the bugs resolution is conditioned to the approval of kivy#7618
  • Loading branch information
DexerBR committed Sep 13, 2021
1 parent 92ff508 commit bf2a903
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions kivy/uix/textinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class Selector(ButtonBehavior, Image):

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.always_release = True
self.matrix = self.target.get_window_matrix()

with self.canvas.before:
Expand Down Expand Up @@ -1618,12 +1619,16 @@ def _handle_released(self, instance):
return

self._update_selection()

instance_x = self.to_window(instance.x, 0, False, True)[0]
instance_right = self.to_window(instance.right, 0, False, True)[0]
instance_top = self.to_window(0, instance.top, False, True)[1]
self._show_cut_copy_paste(
(
instance.right
instance_right
if instance is self._handle_left
else instance.x,
instance.top + self.line_height
else instance_x,
instance_top + self.line_height
),
EventLoop.window
)
Expand All @@ -1647,6 +1652,7 @@ def _handle_move(self, instance, touch):
x,
y + instance._touch_diff + (self.line_height / 2)
)
self.cursor = cursor

if instance != touch.grab_current:
return
Expand All @@ -1662,6 +1668,7 @@ def _handle_move(self, instance, touch):
self._selection_from = cindex
elif instance == handle_right:
self._selection_to = cindex
self._update_selection()
self._trigger_update_graphics()
self._trigger_position_handles()

Expand Down

0 comments on commit bf2a903

Please sign in to comment.