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

Commit

Permalink
fixing copy dna bps issue when in isProtein mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed May 10, 2021
1 parent b16b87e commit 1c1f04b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -189,7 +189,6 @@ These props consist of hooks and editor config options that can be passed like s
console.info("sequenceData:", copiedSequenceData);
console.info("editorState:", editorState);
const clipboardData = event.clipboardData;
clipboardData.setData("text/plain", copiedSequenceData.sequence);
clipboardData.setData(
"application/json",
JSON.stringify(copiedSequenceData)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -35,7 +35,7 @@
"@risingstack/react-easy-state": "^6.3.0",
"@teselagen/react-list": "^0.8.18",
"axios": "^0.21.1",
"bio-parsers": "^8.3.5",
"bio-parsers": "^8.3.7",
"classnames": "^2.3.1",
"clipboard": "^2.0.8",
"color": "^3.1.3",
Expand Down
14 changes: 12 additions & 2 deletions src/withEditorInteractions/index.js
Expand Up @@ -616,7 +616,14 @@ function VectorInteractionHOC(Component /* options */) {
},
didMount: ({ className }) => {
// TODO: Maybe use a cut action instead
this.openVeCut = makeTextCopyable((i) => i, className, "cut");
this.openVeCut = makeTextCopyable(
(s) => ({
...s,
textToCopy: isProtein ? s.proteinSequence : s.sequence
}),
className,
"cut"
);
}
}
]),
Expand All @@ -631,7 +638,10 @@ function VectorInteractionHOC(Component /* options */) {
this.openVeCopy2 && this.openVeCopy2.destroy();
},
didMount: ({ className }) => {
this.openVeCopy2 = makeTextCopyable((i) => i, className);
this.openVeCopy2 = makeTextCopyable(
(s) => ({ ...s, textToCopy: s.sequence }),
className
);
}
},

Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Expand Up @@ -3489,10 +3489,10 @@ bindings@^1.5.0:
dependencies:
file-uri-to-path "1.0.0"

bio-parsers@^8.3.5:
version "8.3.5"
resolved "https://registry.yarnpkg.com/bio-parsers/-/bio-parsers-8.3.5.tgz#cdcda8f230cef428601f9d6cdfdb1f3e3b231bdd"
integrity sha512-1sl2PGtb/D7LIqoHqRoKQkMLEwJkn4l/WQfRYia3lh/SBmN1MCu9JkzzFlNqAxdBJiMWZkUfP9MPWxTgzED2rQ==
bio-parsers@^8.3.7:
version "8.3.7"
resolved "https://registry.yarnpkg.com/bio-parsers/-/bio-parsers-8.3.7.tgz#7087813010c64a5a8adfc0035e9bf9f4e8808e95"
integrity sha512-vP8y6usjGYiK4aQuk5mCcx7CO0QNRt66j8eVeWLOD/6itgmR8h724pVX3rHJQNMh0MksYVSX1kAVSKfAgZEkCw==
dependencies:
"@gmod/gff" "^1.1.2"
buffer "^6.0.3"
Expand Down Expand Up @@ -7255,9 +7255,9 @@ hoist-non-react-statics@^3.3.2:
react-is "^16.7.0"

hosted-git-info@^2.1.4:
version "2.8.9"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
version "2.7.1"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==

hpack.js@^2.1.6:
version "2.1.6"
Expand Down

0 comments on commit 1c1f04b

Please sign in to comment.