You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Copy did not work from embedded iframes (#1528)
- embedded iframes require the 'clipboard-write' permission to copy in
Chrome. Added note to the README
- Display an error correctly if the copy doesn't succeed, and added unit
test
- Fixed context menu as well - default menu handler did not return an
array as it should've
- Tested in Firefox and Chrome on Linux
- Fixes#1527
---------
Co-authored-by: Matthew Runyon <mattrunyonstuff@gmail.com>
Copy file name to clipboardExpand all lines: packages/embed-grid/README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,24 @@ This project uses [Vite](https://vitejs.dev/). It is to provide an example React
12
12
13
13
-`name`: Required. The name of the table to load
14
14
15
+
## Usage
16
+
17
+
You simply need to provide the URL to embed the iframe. Also add the `clipboard-write` permission to allow copying when embedded, e.g.:
18
+
19
+
```
20
+
<html>
21
+
<body>
22
+
<h1>Dev</h1>
23
+
<iframe
24
+
src="http://localhost:4010/?name=t"
25
+
width="800"
26
+
height="500"
27
+
allow="clipboard-write"
28
+
></iframe>
29
+
</body>
30
+
</html>
31
+
```
32
+
15
33
## API
16
34
17
35
The iframe provides an API to perform some basic actions with the table loaded. Use by posting the command/value as a [postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to the `contentWindow` of the iframe element, e.g. `document.getElementById('my-iframe').contentWindow.postMessage({ command, value }, 'http://localhost:4010')`
0 commit comments