Clicking a Widget with a click() hook doesn't trigger clickOutside() on other widgets


(Emma Lejeck) #1

This is kind of a strange technical bug, but clickOutside() doesn’t trigger if the widget you click (outside) has a click() hook.

Reproduction:

  1. Open “Post Admin” menu
  2. Click “Like” or “Link” button
  3. “Post Admin” menu doesn’t disappear

What I Expect:

  1. Open “Post Admin” menu
  2. Click “Like” or “Link” button
  3. “Post Admin” menu disappears

I should add that this “expected” behavior is also the behavior when clicking noninteractive elements outside the menu.

The code is likely this early return in the WidgetClickHook, which will trigger for any widget with a click handler, preventing it from reaching the handling for clickOutside below. This should probably trigger clickOutside on any widgets which aren’t the widget that you triggered click on or its ancestors, instead.


(Robin Ward) #2

Good catch! Here’s a fix:


(Robin Ward) #3