Skip to content

Commit 2430a64

Browse files
xaircorelmtierney
authored andcommitted
[oy] Fix issue with w3c actions releasing on element (#5180)
Releasing a held mouse button on an element
1 parent c067d6b commit 2430a64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/selenium/webdriver/common/action_chains.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ def release(self, on_element=None):
331331
- on_element: The element to mouse up.
332332
If None, releases on current mouse position.
333333
"""
334+
if on_element:
335+
self.move_to_element(on_element)
334336
if self._driver.w3c:
335337
self.w3c_actions.pointer_action.release()
336338
self.w3c_actions.key_action.pause()
337339
else:
338-
if on_element:
339-
self.move_to_element(on_element)
340340
self._actions.append(lambda: self._driver.execute(Command.MOUSE_UP, {}))
341341
return self
342342

0 commit comments

Comments
 (0)