Comments (17)
The share link (1) button should create a share link and add it to the user's clipboard. On safari it notifies the user that the link was added to their clipboard (2), but when pasting the share link doesn't come out (whatever was previously in the clipboard does).
from sprig.
Forgot to mention, this works in FF & Chrome. This is probably the related code: https://github.com/hackclub/game-lab/blob/0dcd140b1814897bd1d425f62ca8c4273999fcc7/dispatch.js#L7-L14
from sprig.
from sprig.
Yeah, most browsers only let you copy to the clipboard as a direct result of user interaction.
Chrome lets you explicitly request permission via the Permissions API, but Firefox and Safari don't support it yet
from sprig.
https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
from sprig.
So I've done a little research here, and it turns out the issue is that Safari has some security policies in place that prevent any clipboard commenting to happen unless a DOM event is in scope (so to ensure that a DOM event triggered the copy to clipboard).
I am not sure what the appropriate way of passing the DOM event to the copy function would be with the architecture of Game Lab. @leomcelroy / @cedric-h: this might be a good thing for one of you to handle.
I've tried using various 3rd party clipboard libraries and none of the ones I've tried work, so I'm pretty sure it's down to the DOM event thing.
It looks like this might be a very recent thing. There are some other repos with this issue popping up, notably apache/superset#18154.
from sprig.
Copying doesn't work in any browser for me. Reopening
from sprig.
The diff for https://github.com/hackclub/gamelab/pull/67/files doesn't make sense to me– seems like something was mis-commited or something. If I'm reading it right it seems like it removes copy logic.
from sprig.
@maxwofford @leomcelroy this is my main commit - a7618a3
(#67)
i think something has went wrong, and we've mis-commited something
from sprig.
also @leomcelroy this commit of yours kinda reverted my commit b50ee51
(#67)
from sprig.
Something that might help for fixing this issue: saves are deterministic. Even before we make a post request, we know the share link will be gamelab.hackclub.com/?id=MD5 where MD5 is the hash of the game state
CC'ing @cedric-h who can correct me if I said something wrong.
from sprig.
Copying also doesn't work in any browser for me. How can i fix this?
from sprig.
Can you share the URL that screenshot was taken at? It doesn't look like a part of the gamelab interface
from sprig.
You can copy the URL from the console. Otherwise, it only copies some Javascript
from sprig.
@grymmy can you reproduce this?
from sprig.
Ignore my ask. This is an ongoing issue
from sprig.
An update on this issue - while the editor still does not correctly copy to the clipboard on safari, it shows a high-quality error and feedback to the user when it files to copy to the clipboard. As a result, I believe this is quite low priority - but I've confirmed yes, still a present bug
from sprig.
Related Issues (20)
- Gardenshed should have a brief syntax
- Disambiguate flash from other commands
- Rename debugger commands in gardenshed to be intuitive
- Sprig AI: Implement UI features to support the AI implementation HOT 10
- GET_A_SPRIG.md seems to be outdated.
- Hardware KiCAD file is missing a library
- Spade Docker / Gardenshed: Support PC Build
- Add metadata.json to .gitignore HOT 2
- Gardenshed: gardenshed.py start-debugger doesn't work on Fedora Workstation 39
- Code input field shows email field, confusing users greatly
- Map editor does not open HOT 1
- design more robust debug probe HOT 1
- error not properly displaying when variable declared twice HOT 1
- Add Collaborative Editing to the sprig Editor
- Create UX proposal for Sprig theme picker
- Propose specific UX for new Penny theme
- teleport(spr, newX, newY) HOT 7
- Create new Theme picker dropdown in sprig editor HOT 6
- Map editor does not open when clicking on map thingie HOT 3
- Relocate "I'm stuck", "Run on Device", and "Theme picker" to a dropdown HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sprig.