New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: option to not block non-ReactDnD drag operations #802
Comments
It's surprising that #1240 seems like it will have helped with #457 but there are still other unexpected side effects of the capturing event listeners and their use of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I encountered this again today. |
hunger for it !!! |
I'm having this same issue with a ReactQuill component nested inside a DragSource. My hacky workaround is to conditionally apply the draggable ref, but that breaks text entry in Safari. |
Unfortunately running into the same issue. Using react-dnd pretty much blocks any none-react-dnd operations. Any solution for this? Tried the suggestions in the original issue, but did not fix it for me. |
This problem occurs, is there a solution? |
Pretty late here, but I found that replacing react-dnd on the page where I have another component that was being interfered with was the only solution I could get working. I replaced it with "react-sortablejs" which in my use-case was able to provide the same thing I needed. Not happy to have both libraries installed, but it unblocks for now. If folks have found a react-dnd solution I'd be happy to see! |
Im also having this issue now due to implementing craft.js so I need both to work for various instances on the page. |
'./lib/html5BackEnd'; import { HTML5Backend } from 'react-dnd-html5-backend';
const shouldIgnoreTarget = (domNode: HTMLElement) => {
return domNode.closest('.lexical-editor');
};
const ModifiedBackend = (...args: any) => {
// @ts-ignore
const instance = new HTML5Backend(...args);
const listeners = [
'handleTopDragStart',
'handleTopDragStartCapture',
'handleTopDragEndCapture',
'handleTopDragEnter',
'handleTopDragEnterCapture',
'handleTopDragLeaveCapture',
'handleTopDragOver',
'handleTopDragOverCapture',
'handleTopDrop',
'handleTopDropCapture',
];
listeners.forEach((name) => {
const original = instance[name];
instance[name] = (e: any, ...extraArgs: any) => {
if (!shouldIgnoreTarget(e.target)) {
original(e, ...extraArgs);
}
};
});
return instance;
};
// Decorate root elements with this
export { ModifiedBackend }; Hi guys, lexical dnd is not working when i use with react-dnd. import { QueryClientProvider } from '@tanstack/react-query';
import axios from 'axios';
import React from 'react';
import { DndProvider } from 'react-dnd';
import ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { App } from './App';
import queryClient from './config/reactQuery';
import { ModifiedBackend } from './lib/html5BackEnd';
import { store } from './store';
import './styles/index.css';
axios.defaults.baseURL = 'http://localhost:8080/api/v1';
axios.defaults.withCredentials = true;
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<Provider store={store}>
<BrowserRouter>
<DndProvider backend={ModifiedBackend}>
<App />
</DndProvider>
</BrowserRouter>
</Provider>
</QueryClientProvider>
</React.StrictMode>,
); Then i just need to import ModifiedBackend and use it instead of default html5backend. Dont forget to replace the editor wrapper className with your. |
@nsnl-coder Oh man this helps a lot. Thanks! |
Original Issue
The text was updated successfully, but these errors were encountered: