Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
fix: 修正CopyButton的複製函式的錯誤,textfield.replace is not a function
Browse files Browse the repository at this point in the history
a8568730 committed Jan 8, 2018

Unverified

No user is associated with the committer email.
1 parent fc57205 commit a7e3045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/component/CopyButton.jsx
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ class CopyButton extends React.Component {
copy() {
const { 複製內容 } = this.props;
const textField = document.createElement("textarea");
textField.innerText = 複製內容;
document.body.appendChild(textField.replace(/ --/g, "--"));
textField.innerText = 複製內容.replace(/ --/g, "--");
document.body.appendChild(textField);
textField.select();
document.execCommand("copy");
textField.remove();

0 comments on commit a7e3045

Please sign in to comment.