Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _collapse_maybe(self, e):
# Collapse if the given pointer event is outside the combobox.
# Better version of blur event, sort of. Dont use mouseup, as then
# there's mouse capturing (the event will come from the main widget).
t = e.target
while t is not window.document.body:
if t is self.outernode:
return
t = t.parentElement
window.document.removeEventListener('mousedown', self._collapse_maybe, 1)
self._collapse()
def stopcapture():
# Stop capturing
if self._capture_flag == 2:
self._capture_flag = -1
window.document.removeEventListener("mousemove", mmove_outside, True)
window.document.removeEventListener("mouseup", mup_outside, True)
def stopcapture():
# Stop capturing
if self._capture_flag == 2:
self._capture_flag = -1
window.document.removeEventListener("mousemove", mmove_outside, True)
window.document.removeEventListener("mouseup", mup_outside, True)