Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some recent bugs with emoji autocomplete #1133

Merged
merged 1 commit into from
May 3, 2017

Conversation

maximbaz
Copy link
Contributor

  1. remove_emoji_list is executed multiple times on click, even if emoji popup is closed.

This happens because this.remove_emoji_list.bind(this) creates a new function every time, and window.removeEventListener('click', this.bound_remove_emoji_list) is trying to unassign a different function and silently fails to do so. The fix is to create a bound function and use it to assign and unassign a click-listener, so that addEventListener and removeEventListener are operating on exactly the same function.

  1. Unable to fix typo while typing emoji name

Previously if you entered a typo (like winn), emoji popup was closed, but as soon as you removed the second n it reappeared with suggestions like wink. Now it doesn't reappear, so you have to remove everything and start from scratch. This happenned because when nothing is matched, previously emoji popup was only closed, but then code was changed to actually remove the popup.

/cc @gregor

@gregor
Copy link
Contributor

gregor commented Apr 27, 2017

Thanks. Still getting used to the ES6 stuff

@maximbaz maximbaz force-pushed the emoji-input-fix-bugs branch from b9a1296 to 5ee857a Compare May 2, 2017 14:35
@gregor gregor merged commit 3824804 into wireapp:dev May 3, 2017
lipis added a commit that referenced this pull request May 3, 2017
* 'eslint' of github.com:wireapp/wire-webapp:
  Updated translations (#1168)
  Skipping HTML comments (#1159)
  ES6: migrated "user" (#1138)
  Fix linting
  Return Object in ClientMapper.update_client() (#1158)
  chore(package): update eslint-plugin-jsdoc to version 3.0.2 (#1164)
  dont display blocked top people (#1163)
  Per-user count-based alphabetic emoji ordering (#1126)
  Fix removeEventListener on mouse click, fix emoji popup reappearing after a typo (#1133)
  Fix emoji flags detection (#1162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants