Skip to content

Commit

Permalink
Merge pull request #23846 from margelo/emoji-picker-search
Browse files Browse the repository at this point in the history
Search throttle for emoji picker web
  • Loading branch information
stitesExpensify authored Oct 17, 2023
2 parents 161c3e6 + c18bf28 commit 9aa14f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/EmojiPicker/EmojiPickerMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import getOperatingSystem from '../../../libs/getOperatingSystem';
import * as User from '../../../libs/actions/User';
import EmojiSkinToneList from '../EmojiSkinToneList';
import * as EmojiUtils from '../../../libs/EmojiUtils';
import * as Browser from '../../../libs/Browser';
import CategoryShortcutBar from '../CategoryShortcutBar';
import TextInput from '../../TextInput';
import isEnterWhileComposition from '../../../libs/KeyboardShortcut/isEnterWhileComposition';
Expand Down Expand Up @@ -48,6 +49,7 @@ const defaultProps = {
preferredSkinTone: CONST.EMOJI_DEFAULT_SKIN_TONE,
frequentlyUsedEmojis: [],
};
const throttleTime = Browser.isMobile() ? 200 : 50;

class EmojiPickerMenu extends Component {
constructor(props) {
Expand All @@ -63,7 +65,7 @@ class EmojiPickerMenu extends Component {
// prevent auto focus when open picker for mobile device
this.shouldFocusInputOnScreenFocus = canFocusInputOnScreenFocus();

this.filterEmojis = _.debounce(this.filterEmojis.bind(this), 300);
this.filterEmojis = _.throttle(this.filterEmojis.bind(this), throttleTime);
this.highlightAdjacentEmoji = this.highlightAdjacentEmoji.bind(this);
this.setupEventHandlers = this.setupEventHandlers.bind(this);
this.cleanupEventHandlers = this.cleanupEventHandlers.bind(this);
Expand Down

0 comments on commit 9aa14f8

Please sign in to comment.