mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
emoji picker: Move cursor to end of filter string when focusing.
This is a much less annoying behavior than the Chrome browser default. Explanatory comment added by tabbott, thanks to Steve Howell for the research. Fixes #4604.
This commit is contained in:
committed by
Tim Abbott
parent
235d06e7e5
commit
9b9c323314
@@ -177,8 +177,15 @@ exports.reaction_navigate = function (e, event_name) {
|
||||
$(first_emoji).focus();
|
||||
}
|
||||
} else if (event_name === 'up_arrow') {
|
||||
if (selected_emoji && selected_index < 6) { // move up into reaction filter
|
||||
$('.emoji-popover-filter').focus();
|
||||
if (selected_emoji && selected_index < 6) {
|
||||
// In this case, we're move up into the reaction filter
|
||||
// rows. Here, we override the default browser behavior,
|
||||
// which in Firefox is good (preserving the cursor
|
||||
// position) and in Chrome is bad (cursor goes to
|
||||
// beginning) with something reasonable and consistent
|
||||
// (cursor goes to the end of the filter string).
|
||||
$('.emoji-popover-filter').focus().caret(Infinity);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user