# Text selection is cancelled when the AI popup disappears

**URL:** https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897
**Category:** Bug
**Tags:** composer, fast-edit
**Created:** [September 24, 2023, 1:02am UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897 "2023-09-24T01:02:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [September 24, 2023, 1:02am UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/1 "2023-09-24T01:02:46Z")

</div>

When we quickly edit a message, unwanted problems occur in the editor. For example, after selecting a word to make it bold, the selection is canceled when the mouse is hovered over the bold button. This applies to all buttons. For example, when the AI button appears after the selection, the selection is canceled when we hover over it with the mouse.

I made a video so you can understand.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [September 24, 2023, 1:28am UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/2 "2023-09-24T01:28:45Z")

</div>

yea I noticed it too on Meta recently. I think it’s this again

> [@Cursor jumping around in composer / editor text box](https://meta.discourse.org/t/cursor-jumping-around-in-composer-editor-text-box/263017):
>
> the cursor seems to be jumping around in the composer / editor. anyone else experiencing this? i’ve had it in both mobile and desktop views on my forum in chrome and safari. it happens when i have a quote in the text box or some text i am editing. the cursor jumps to another place when i start to type or even sometimes if the mouse cursor goes off the text box without clicking. i haven’t had it yet on Meta here but it’s been happening lately on our forum to me and others. also doesn’t happen a…

I get it sometimes using the regular edit, not just quick edit.

---

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [September 24, 2023, 1:48am UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/3 "2023-09-24T01:48:10Z")

</div>

I saw your thread before opening this thread but thought it was different. I think it’s because of my naughty English 😕 I only get this error in quick editing. I tried in [safe mode](https://meta.discourse.org/t/53504?silent=true). I have the same problem on my own site and meta. I think other sites have this problem too.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [September 25, 2023, 10:52am UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/4 "2023-09-25T10:52:54Z")

</div>

Hi kuaza!

Thanks for the report.

~~I can repro it without using the fast edit feature, so I’ve removed the tag.~~

I think it’s more related to the AI popup. The selection is canceled when the popup disappears.

Edit: I could repro the issue without fast edit, but now I cannot. I think the repro steps need to be more accurately defined.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [September 25, 2023, 11:07am UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/5 "2023-09-25T11:07:25Z")

</div>

I think I got it.

1. Use fast edit but make it open the composer instead of the fast edit popup.

2. Then, select any text in the composer. The AI helper popup shows up.

3. Move the cursor to make the AI helper popup disappear, either by hovering this popup and move the cursor away or move the cursor away from the composer text area.

4. The selection is canceled.

If you close the composer, and edit the post without using the fast selection, the issue remains until you refresh the page.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 25, 2023, 3:08pm UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/7 "2023-09-25T15:08:00Z")

</div>

> [@Canapin](#):
>
> The AI helper popup shows up

It does also work without the AI helper  
 ![1](https://global.discourse-cdn.com/meta/original/4X/7/9/8/79803adf61d0925dcd77f511c95943646e6635de.gif)  
(It also works that way on a discourse site where the plugin is not even installed)

---

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [September 25, 2023, 7:03pm UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/12 "2023-09-25T19:03:58Z")

</div>

The problem is not related to any plugin or theme. It continues even when you try turning off add-ons in [safe mode](https://meta.discourse.org/t/53504?silent=true). I tried with another theme, the problem still persists.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [October 26, 2023, 7:23pm UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/13 "2023-10-26T19:23:15Z")

</div>

I think this is fixed no? I can’t repro anything from the videos in this topic.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [November 2, 2023, 7:24pm UTC](https://meta.discourse.org/t/text-selection-is-cancelled-when-the-ai-popup-disappears/279897/14 "2023-11-02T19:24:03Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
