mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 20:34:52 +00:00
Using the `mouseDownOutside` event was problematic here because two events were being triggered consecutively: `mouseDown` would toggle the menu off and `click` would then toggle it back on. This switches the logic to use `clickOutside` again, but with two changes: - it limits the action to the `search-menu` key (so that theme component overrides can do their own handling) - it does not trigger the event when there is an active text selection (this was the original reason for switching to `mouseDownOutside`, see https://github.com/discourse/discourse/pull/14788)