This is kind of a strange technical bug, but clickOutside()
doesn’t trigger if the widget you click (outside) has a click()
hook.
Reproduction:
- Open “Post Admin” menu
- Click “Like” or “Link” button
- “Post Admin” menu doesn’t disappear
What I Expect:
- Open “Post Admin” menu
- Click “Like” or “Link” button
- “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.