diff options
| author | Alexandre Kühn <aku@odoo.com> | 2019-01-30 11:59:51 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2019-01-30 12:23:28 +0000 |
| commit | 1a774f9e0e9dbc67cf9661d6aa07f5ce5640d779 (patch) | |
| tree | 638b8033cbfbb4eae8a951498a87998f71aa7e33 /addons/mail/static/src/js/composers/basic_composer.js | |
| parent | 1dac41313005c9035a5f8d3c9db83dcad7883f24 (diff) | |
[FIX] mail: click on item from composer's emoji menu
Before this commit, clicking on an item from the
emoji menu of a composer was not putting the emoji
in the input.
Steps to reproduce:
- Open discuss app
- Select a conversation with a composer
- click on emoji menu in the right-side of the composer
- click on an emoji in the emoji menu
> the emoji has not been put in the input of the composer
This problem was caused by a race condition with the event
`focusout` on the emoji button and the `click` on an emoji
item. `focusout` always happens before `click`, and `click`
event following a `focusout` event can only happen when the
element is visible. This was not the case, because the emoji
container is removed from the `focusout`, so no `click` is
triggered on the emoji item.
This commit fixes the issue by listening on `mousedown` on
the emoji item instead of `click`, which is triggered before
`focusout`.
closes odoo/odoo#30694
Diffstat (limited to 'addons/mail/static/src/js/composers/basic_composer.js')
| -rw-r--r-- | addons/mail/static/src/js/composers/basic_composer.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js index 09c521ad795..af503ff2711 100644 --- a/addons/mail/static/src/js/composers/basic_composer.js +++ b/addons/mail/static/src/js/composers/basic_composer.js @@ -26,7 +26,7 @@ var BasicComposer = Widget.extend({ 'click .o_composer_button_add_attachment': '_onClickAddAttachment', 'click .o_composer_button_emoji': '_onEmojiButtonClick', 'focusout .o_composer_button_emoji': '_onEmojiButtonFocusout', - 'click .o_mail_emoji_container .o_mail_emoji': '_onEmojiImageClick', + 'mousedown .o_mail_emoji_container .o_mail_emoji': '_onEmojiImageClick', 'focus .o_mail_emoji_container .o_mail_emoji': '_onEmojiImageFocus', 'dragover .o_file_drop_zone_container': '_onFileDragover', 'drop .o_file_drop_zone_container': '_onFileDrop', |
