Fix: Ctrl + C not working on tooltips (#2418)

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.
This commit is contained in:
anovazzi1 2024-06-28 20:25:24 +00:00 committed by GitHub
commit 659fe349a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {