Horizontal rule steals focus from emoji picker in the composer

When using the emoji picker with the cursor on a line immediately preceding a horizontal rule, pressing causes the horizontal rule to steal focus and close the emoji picker.

Steps to reproduce:

  1. Start typing an emoji on a line preceding a horizontal rule. Wait for the emoji picker to open.
  2. Press .

Expected behaviour:

The emoji picker cycles through the options.

Actual behaviour:

The horizontal rule receives focus and the emoji picker is closed.

Screen recording:

horizontal-rule-focus-stealing

2 Likes

The fix seems simple enough. Just not sure if this has any unintended consequences for the composer. CI is broken at the moment, but if the composer system tests pass for me locally.

https://github.com/discourse/discourse/pull/40052