i’m trying to trackdown a frontend issue on my plugin (full source GitHub - Language-Tools/baserow-vocabai-plugin: VocabAi - plugin for Baserow database)
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.
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):
Second, the problematic case, you can see copyEventListener (gridField.js:175) appears twice:
Looks like the origin of the second copyEventListener is over here: web-frontend/modules/database/utils/clipboard.js · master · Baserow / baserow · GitLab
further up the call stack we have this: web-frontend/modules/database/mixins/copyPasteHelper.js · master · Baserow / baserow · GitLab
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.