# Emojiが違う場所に挿入される

**URL:** <https://meta.discourse.org/t/emoji-is-inserted-at-the-wrong-place/302931>\
**Category:** Bug\
**Tags:** emoji\
**Created:** [2024 年 4 月 8 日午後 8:40 UTC](https://meta.discourse.org/t/emoji-is-inserted-at-the-wrong-place/302931 "2024-04-08T20:40:25Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2025 年 11 月 6 日午前 12:07 UTC](https://meta.discourse.org/t/emoji-is-inserted-at-the-wrong-place/302931/13 "2025-11-06T00:07:31Z")

</div>

境界検出のバグですね。絵文字の開始位置と終了位置が混同しています。

難しいのは、カーソル位置と絵文字オートコンプリートに渡された文字数が正確にわかっているのに、なぜこのような判断が必要なのか、ロジック全体が間違っている可能性があることです。N文字分戻ってから置き換えるだけでいいのかもしれません。よくわかりません。

---

_[View the full topic](https://meta.discourse.org/t/emoji-is-inserted-at-the-wrong-place/302931)._
