Skip to content

Commit

Permalink
dont focus search on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Sep 19, 2023
1 parent 5fe47cb commit ec535fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/lib/emoji-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export const dialogActions = {
$html.addClass('emoji-insert');
dialog.addClass('open');
dialog.appendTo(document.fullscreenElement || 'body');
dialog.find('.emoji-dialog-search').focus();
if (!utils.isTouchDevice()) {
dialog.find('.emoji-dialog-search').focus();
}

// need this setTimeout or onDocumentClick gets triggered too early
// and causes https://github.com/NodeBB/NodeBB/issues/10589
setTimeout(() => {
Expand Down
1 change: 1 addition & 0 deletions public/lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare const ajaxify: {
};
declare const utils: {
generateUUID(): string;
isTouchDevice(): boolean;
};

interface String {
Expand Down

0 comments on commit ec535fb

Please sign in to comment.