# Hard freeze on chrome when copying field - gridField.copyEventListener recursively calls itself

**URL:** https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829
**Category:** Technical Help
**Tags:** plugin, self-hosting
**Created:** [May 27, 2023, 3:13am UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829 "2023-05-27T03:13:05Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![lucw](https://community.baserow.io/user_avatar/community.baserow.io/lucw/32/609_2.png) [@lucw](https://community.baserow.io/u/lucw)
#### Post date: [May 27, 2023, 3:13am UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/1 "2023-05-27T03:13:05Z")

</div>

i’m trying to trackdown a frontend issue on my plugin (full source [GitHub - Language-Tools/baserow-vocabai-plugin: VocabAi - plugin for Baserow database](https://github.com/Language-Tools/baserow-vocabai-plugin))  
When doing ctrl+c on a field (happens on regular text fields, not just my custom fields), chrome will freeze for around 20 seconds. It’s hard freeze and I can’t do anything, nothing in chrome is responsive.

I tracked this down to the copy logic after overriding prepareValueForCopy for my field type. As I said it seems to be happening on the “Single line text” field type, which I didn’t modify in any way. It only happens inside my plugin, doesn’t happen on [baserow.io](http://baserow.io).

What I see happening is that the **copyEventListener** method on **gridField** seems to be recursively calling itself. I captured two stack traces in chrome dev tools:

First, the regular case (starts with gridField.js:175):

 ![copy_event_listener_regular](https://community.baserow.io/uploads/default/original/2X/e/e9a6a6303c02953d20836e774368068058db8d02.png)  
Second, the problematic case, you can see copyEventListener (gridField.js:175) appears twice:  
 ![copy_event_listener_recursive](https://community.baserow.io/uploads/default/original/2X/2/2d4e661721c875ba7b6d30ecfd2e436ccc9ddefe.png)

Looks like the origin of the second copyEventListener is over here: [web-frontend/modules/database/utils/clipboard.js · master · Baserow / baserow · GitLab](https://gitlab.com/baserow/baserow/-/blob/master/web-frontend/modules/database/utils/clipboard.js#L64)

further up the call stack we have this: [web-frontend/modules/database/mixins/copyPasteHelper.js · master · Baserow / baserow · GitLab](https://gitlab.com/baserow/baserow/-/blob/master/web-frontend/modules/database/mixins/copyPasteHelper.js#L66)

and it seems in my case, `navigator.clipboard` is not available, according to stackoverflow this is because i’m not running over https (during development).

So this could be a development only issue, but the alternative code when `navigator.clipboard` is not available seems to have issues. Not sure how to fix, though it seems it won’t affect production over https.

---

<div class="post-metadata">

### Author: ![jonadeline](https://community.baserow.io/letter_avatar_proxy/v4/letter/j/ecd19e/32.png) [@jonadeline](https://community.baserow.io/u/jonadeline)
#### Post date: [May 29, 2023, 9:26am UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/2 "2023-05-29T09:26:47Z")

</div>

Hey @lucw  
Have you tried to enable _Insecure origins treated as secure_ in `chrome://flags` ? You can define your origin there and it should make the `navigator.clipboard` available in dev environment.  
Let me know how it goes.

---

<div class="post-metadata">

### Author: ![lucw](https://community.baserow.io/user_avatar/community.baserow.io/lucw/32/609_2.png) [@lucw](https://community.baserow.io/u/lucw)
#### Post date: [May 29, 2023, 11:00pm UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/3 "2023-05-29T23:00:27Z")

</div>

I will try this, though my other option is to configure https in the dev enviroment. But my concern is that the second path here [web-frontend/modules/database/mixins/copyPasteHelper.js · master · Baserow / baserow · GitLab](https://gitlab.com/baserow/baserow/-/blob/master/web-frontend/modules/database/mixins/copyPasteHelper.js#L66) seems to cause freezing in chrome, seems like a bug. Does this second path work for anyone ? Maybe it should be disabled ?

---

<div class="post-metadata">

### Author: ![marcus](https://community.baserow.io/user_avatar/community.baserow.io/marcus/32/1289_2.png) [@marcus](https://community.baserow.io/u/marcus)
#### Post date: [May 31, 2023, 7:04pm UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/4 "2023-05-31T19:04:40Z")

</div>

Hey, I reported this bug few days, mayme weeks ago. If I select just one cell and try to copy (CTRL+C), them my browser freezes and the whope PC system starts to be non-responsive (the onli option is to kill the proces n Task Manager). This happens in ANY browser, not just in Chrome.  
I was told that devs will focus on it an will contact me to try make some more deep inspection of it.

---

<div class="post-metadata">

### Author: ![olgatrykush](https://community.baserow.io/user_avatar/community.baserow.io/olgatrykush/32/219_2.png) [@olgatrykush](https://community.baserow.io/u/olgatrykush)
#### Post date: [May 31, 2023, 8:07pm UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/5 "2023-05-31T20:07:12Z")

</div>

Hey @marcus thanks! @lucw here is the link: [Copy/Paste one single field (text type) to another one gets my PC to a hang on status](https://community.baserow.io/t/copy-paste-one-single-field-text-type-to-another-one-gets-my-pc-to-a-hang-on-status/2774).

---

<div class="post-metadata">

### Author: ![nigel](https://community.baserow.io/user_avatar/community.baserow.io/nigel/32/51_2.png) [@nigel](https://community.baserow.io/u/nigel)
#### Post date: [June 6, 2023, 2:59pm UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/6 "2023-06-06T14:59:58Z")

</div>

Hi @lucw thanks a ton for this great find, this is exactly what is causing @marcus 's bug. Just got back from holiday but will try and get this fix in for the release next week.

---

<div class="post-metadata">

### Author: ![marcus](https://community.baserow.io/user_avatar/community.baserow.io/marcus/32/1289_2.png) [@marcus](https://community.baserow.io/u/marcus)
#### Post date: [June 8, 2023, 7:26am UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/7 "2023-06-08T07:26:39Z")

</div>

Thanks! Waiting eagerly for this fix.

---

<div class="post-metadata">

### Author: ![marcus](https://community.baserow.io/user_avatar/community.baserow.io/marcus/32/1289_2.png) [@marcus](https://community.baserow.io/u/marcus)
#### Post date: [June 16, 2023, 7:02am UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/8 "2023-06-16T07:02:47Z")

</div>

Looks, like it’s fixed now in the version 1.18.

---

<div class="post-metadata">

### Author: ![lucw](https://community.baserow.io/user_avatar/community.baserow.io/lucw/32/609_2.png) [@lucw](https://community.baserow.io/u/lucw)
#### Post date: [June 16, 2023, 7:25am UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/9 "2023-06-16T07:25:04Z")

</div>

Many thanks baserow team, will give it a try in a bit after I upgrade by plugin to 1.18

---

<div class="post-metadata">

### Author: ![lucw](https://community.baserow.io/user_avatar/community.baserow.io/lucw/32/609_2.png) [@lucw](https://community.baserow.io/u/lucw)
#### Post date: [June 23, 2023, 2:22pm UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/10 "2023-06-23T14:22:20Z")

</div>

I can confirm this issue is fixed after migrating my plugin to 1.18

---

<div class="post-metadata">

### Author: ![marcus](https://community.baserow.io/user_avatar/community.baserow.io/marcus/32/1289_2.png) [@marcus](https://community.baserow.io/u/marcus)
#### Post date: [June 23, 2023, 4:33pm UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/11 "2023-06-23T16:33:51Z")

</div>

what plugin are you talking about?

---

<div class="post-metadata">

### Author: ![lucw](https://community.baserow.io/user_avatar/community.baserow.io/lucw/32/609_2.png) [@lucw](https://community.baserow.io/u/lucw)
#### Post date: [June 24, 2023, 5:01am UTC](https://community.baserow.io/t/hard-freeze-on-chrome-when-copying-field-gridfield-copyeventlistener-recursively-calls-itself/2829/12 "2023-06-24T05:01:45Z")

</div>

Baserow allows you to develop extensions to the platform using the plugin system. You have to pick a baserow version when you develop such a plugin, which is one of the wonderful aspects, as baserow fixes bugs, my plugin will benefit from those.
