Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
c2102b79
Unverified
Commit
c2102b79
authored
Jun 28, 2021
by
bunsenstraat
Committed by
GitHub
Jun 28, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1335 from ethereum/copyfix
href shouldn't work
parents
941d0b63
92f36d8d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
copy-to-clipboard.tsx
...clipboard/src/lib/copy-to-clipboard/copy-to-clipboard.tsx
+4
-2
No files found.
libs/remix-ui/clipboard/src/lib/copy-to-clipboard/copy-to-clipboard.tsx
View file @
c2102b79
...
...
@@ -6,7 +6,7 @@ import './copy-to-clipboard.css'
export
const
CopyToClipboard
=
({
content
,
tip
=
'Copy'
,
icon
=
'fa-copy'
,
...
otherProps
})
=>
{
const
[
message
,
setMessage
]
=
useState
(
tip
)
const
handleClick
=
()
=>
{
const
handleClick
=
(
event
)
=>
{
if
(
content
&&
content
!==
''
)
{
// module `copy` keeps last copied thing in the memory, so don't show tooltip if nothing is copied, because nothing was added to memory
try
{
if
(
typeof
content
!==
'string'
)
{
...
...
@@ -20,6 +20,8 @@ export const CopyToClipboard = ({ content, tip='Copy', icon='fa-copy', ...otherP
}
else
{
setMessage
(
'Cannot copy empty content!'
)
}
event
.
preventDefault
()
return
false
}
const
reset
=
()
=>
{
...
...
@@ -27,7 +29,7 @@ export const CopyToClipboard = ({ content, tip='Copy', icon='fa-copy', ...otherP
}
return
(
<
a
href=
"#"
onClick=
{
handleClick
}
onMouseLeave=
{
reset
}
>
<
a
href=
'#'
onClick=
{
handleClick
}
onMouseLeave=
{
reset
}
>
<
OverlayTrigger
placement=
"right"
overlay=
{
<
Tooltip
id=
"overlay-tooltip"
>
{
message
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment