Commit cee11b3
authored
Fix clipboard button in
### Motivation
In zauberzeug#5177 we noticed that the copy button writes old content to the
clipboard when the content of `ui.code` has been updated:
```py
c = ui.code('old content')
c.content = 'new content'
```
Clicking the button will write "old content" to the clipboard.
### Implementation
This PR introduces a new "content" prop to hold the raw (non-HTML)
version of the content. When clicking the copy button, a JavaScript call
will write the value of this prop to the clipboard.
### Progress
- [x] I chose a meaningful title that completes the sentence: "If
applied, this PR will..."
- [x] The implementation is complete.
- [x] Pytests are probably not necessary (and probably pretty hard to
write).
- [x] Documentation is not necessary.ui.code after content has been changed (zauberzeug#5298)1 parent a234dd0 commit cee11b3
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
0 commit comments