mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
compose: Fix topics required banner closing on enter to send.
We were updating the compose banners on every `keyup` event on the
topic input. Since, `keyup` also gets triggered for the modifier and
non-printing keys such as "Enter", this lead to banner for topic
required being closed via the `check_posting_policy_for_compose_box`
when pressing "Enter" to send a message with no topic.
This bug was probably introduced in 5c993f0
, which moved additional
logic into `update_on_recipient_change`.
To solve this issue, we use the `input` event instead of the `keyup`
event to update the compose banners only when the value inside the
input element changes.
This change also prevents the the compose banner from being closed
when we only press modifier keys - such as Shift.
This commit is contained in:
@@ -324,10 +324,10 @@ export function initialize() {
|
||||
on_hidden_callback,
|
||||
}).setup();
|
||||
|
||||
// `keyup` isn't relevant for streams since it registers as a change only
|
||||
// `input` isn't relevant for streams since it registers as a change only
|
||||
// when an item in the dropdown is selected.
|
||||
$("#stream_message_recipient_topic,#private_message_recipient").on(
|
||||
"keyup",
|
||||
"input",
|
||||
update_on_recipient_change,
|
||||
);
|
||||
// changes for the stream dropdown are handled in on_compose_select_recipient_update
|
||||
|
Reference in New Issue
Block a user