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:
commit
659fe349a5
1 changed files with 7 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue