evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
3.44k stars 167 forks source link

Component copy-paste not working (Firefox) #747

Closed archiewood closed 1 year ago

archiewood commented 1 year ago

Bug Description I tried to copy a page into an email. Not all components copied as expected. In particular:

do not copy correctly

Severity

Error Messages and Screenshots CleanShot 2023-04-10 at 10 42 08

Workarounds for barcharts, download images and insert manually. No clear workaround for BigValue

Environment Information Operating System: MacOS Package versions: 15.0.1

archiewood commented 1 year ago

Once we fix this, this would be a good candidate for a UI test

mcrascal commented 1 year ago
csjh commented 1 year ago

I think it's just 2 counts of select-none -- BigValue needs the select-none tailwind class to be toggled when a copy event happens, and the charts need the select-none that's placed on the container div (by echarts) to be overriden in the generated img.

ItsMeBrianD commented 1 year ago

@archiewood I am unable to reproduce this issue on the current main branch;

https://user-images.githubusercontent.com/10779616/235983236-8ad16249-cdb8-463f-9e66-0ad821d53a70.mp4

archiewood commented 1 year ago

Hmmm interesting.

Maybe this was fixed recently

Are you able to reproduce on the datacouncil demo?

https://evidence-datacouncil-demo.netlify.app

archiewood commented 1 year ago

(It's running v15.0.0)

ItsMeBrianD commented 1 year ago

Works properly for me there; which browser are you using? I'm on MacOS with Chrome

hughess commented 1 year ago

One other thing I've noticed on this issue is that the copy-paste can behave differently based on different paste destinations. These are the ones I've been trying it on:

archiewood commented 1 year ago

Firefox 🤷🏼‍♂️

archiewood commented 1 year ago

Digging into this a little:

csjh commented 1 year ago

In my testing, putting user-select: all on the BigValue/generated img for charts + forcing Svelte to update synchronously via flush() fixes this. Not sure how big the performance hit of it on large pages would be though.

ItsMeBrianD commented 1 year ago

@csjh do you want to open a PR with the fixes you did?