Skip to content

Commit

Permalink
Fix: Ctrl + C not working on tooltips (#2418)
Browse files Browse the repository at this point in the history
This PR addresses an issue where Ctrl + C was not working correctly
within tooltips. This fix ensures that users can copy text from tooltips
using the Ctrl + C shortcut without any issues.
  • Loading branch information
anovazzi1 authored Jun 28, 2024
2 parents f19431e + 85ba7a5 commit 659fe34
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,13 @@ export default function Page({
}

function handleCopy(e: KeyboardEvent) {
if (!isWrappedWithClass(e, "nocopy")) {
const multipleSelection = lastSelection?.nodes
? lastSelection?.nodes.length > 0
: false;
if (
!isWrappedWithClass(e, "nocopy") &&
(isWrappedWithClass(e, "react-flow__node") || multipleSelection)
) {
e.preventDefault();
(e as unknown as Event).stopImmediatePropagation();
if (window.getSelection()?.toString().length === 0 && lastSelection) {
Expand Down

0 comments on commit 659fe34

Please sign in to comment.