Dragging is disabled once a MUI modal, tooltip, or popover is opened

While working with React MUI, I have encountered an issue where some components are disabling my draggables functionalities.

I have successfully added draggables to my page and they work as expected. However, whenever a draggable is being dragged, certain nodes on the page are modified.

Specifically, when using tooltips, modals, or menus on my React MUI page, opening and closing them seems to prevent draggables from functioning properly. It appears that any changes to elements on the page cause the drag action to end abruptly.

Could there be an event triggering this behavior or some other factor causing the drag action to be interrupted by element modifications?

Answer №1

After some experimenting, I discovered a solution. Interestingly, this issue seems to only arise on Chrome and Safari browsers. By including a 10ms setTimeout before manipulating the DOM, everything works as expected.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Attempt to import Recharts into React was unsuccessful

I am currently exploring the use of recharts in a React project, but I am facing difficulties when trying to import components from its library. I have added it to my package.json file as follows: "recharts": "^2.0.9", However, I am ...

Having trouble retrieving a value from a .JSON file (likely related to a path issue)

My React component is connected to an API that returns data: class Item extends Component { constructor(props) { super(props); this.state = { output: {} } } componentDidMount() { fetch('http://localhost:3005/products/157963') ...

Error in typescript: The property 'exact' is not found in the type 'IntrinsicAttributes & RouteProps'

While trying to set up private routing in Typescript, I encountered the following error. Can anyone provide assistance? Type '{ exact: true; render: (routerProps: RouterProps) => Element; }' is not compatible with type 'IntrinsicAttribu ...

Formik initialization does not prevent undefined errors in MUI textfield error and helpertext

It's perplexing why I keep encountering this issue - it has popped up a few times when attempting to utilize nested objects with Formik, React, and TypeScript. It appears that Formik is not compatible with data containing nested objects? https://i.st ...

What is the best way to bundle .scss files while releasing Storybook components in an npm package?

After successfully publishing my Storybook components in an npm package (let's call it my-storybook) and following the guidelines provided in this tutorial: I encountered an issue when trying to utilize them in a project. For each component exported ...

MUI Autocomplete causing a never-ending cycle of requests

One of the challenges I'm facing involves an Autocomplete component in my code. Here's a snippet of the code: <Autocomplete filterOptions={(x) => x} options={items} getOptionLabel= ...

Mysterious dual invocation of setState function in React

My component is designed to display a list of todos like: const todosData = [ { id: 1, text: "Take out the trash", completed: true }, { id: 2, text: "Grocery shopping", completed: false }, ]; ...

Choosing an option in react-select causes the page to unexpectedly shift

Encountering a problem with a mobile modal developed using react-select. The selectors are within a div with fixed height and overflow-y: scroll. Upon selecting an option for the 'Choose observer' select, the entire modal briefly jumps down in th ...

Tips for specifying the type when utilizing the spread operator to pass props

type TypeData = { data: { id: string; class: string; name: string; country: string; ew_get_url: string; ew_post_url: string; rocket_id: string; pages: { landing: { h1: string; h2: string; } ...

There is an issue with types in React when using TypeScript: The type '(user: User) => Element' cannot be assigned to the type '((props: User) => any) & ReactNode'

I'm encountering an error in the terminal and need some assistance. I am not well-versed in TypeScript, so any guidance to resolve this issue would be highly appreciated. https://i.stack.imgur.com/PWATV.png The Loadable component code: import { Circ ...

Unusual glitch with paint/rendering in Safari while navigating through a lengthy list of content

Encountering a peculiar problem where a page displaying a grid of boxes is experiencing issues in Safari, Chrome on iPhone 11 Pro, iPhone 13 Pro, and Chrome on Pixel 4a. Other devices are not affected. Symptoms include unresponsiveness and blank sections a ...

When converting to a React Functional Component using Typescript, an error occurred: The property 'forceUpdateHandler' could not be found on the type 'MutableRefObject<Spinner | null>'

Looking to convert the App component in this CodePen into a Functional component using Typescript. Encountering an error when attempting to run it: ERROR in src/App.tsx:13:14 TS2339: Property 'forceUpdateHandler' does not exist on type 'Mu ...

What are the ideal scenarios for using a MobX observable over a React state variable?

I'm feeling a bit uncertain. My go-to is usually observables for tracking variables that impact rendering, but I'm questioning whether it's the best approach. How can I determine when it's more appropriate to use state over an observabl ...

Creating Multiple Result Lists in MUI Autocomplete Based on Option Properties: A Step-by-Step Guide

I have a query about displaying results using the MUI Autocomplete component. I am looking to categorize the results into two separate lists placed side by side. Currently, I have a working searchbar with one list of results. However, I aim to segregate t ...

The styling of the Material UI autocomplete listbox does not affect its appearance

I am working on an autocomplete feature that groups items by titles. I am trying to adjust the height of the first group to be different from the rest, but I am facing some challenges since there is no unique identifier for the ul component. To work around ...

initiate file transfer

I am currently developing a web application using NextJS with TRPC. Within the app, there is a form that requires users to select a file. My goal is to pass this file through a TRPC call to handle all file-related logic on the backend rather than the front ...

Error encountered when passing props to child components in NextJS

I have a file that defines two types: type IServiceItems = { fields: { name: string; description: string; logo: { fields: { file: { url: string; }; }; }; }; }; type ITechItems = { fields: { n ...

Exploring ways to customize the styles of MUI Accordion components in a Next.js project using CSS modules

I'm trying to customize the default MUI CSS for the accordion component using a CSS module. The issue I'm facing is that the class is dynamically added by MUI, making it impossible to target directly. Here's the solution I attempted, but it ...

Is there a way to modify the code so that upon refreshing, only the randomly selected 20 items are displayed without showing the ordered items?

Recently, I posed a query and sought assistance on getting 20 random items from a specific JSON file. After implementing one of the suggested solutions, here is the script that I employed: const data = Myjson; useEffect(() => { for (let i = data ...

Tips for adjusting the hover effect on CardActionArea or ButtonBase

I'm currently utilizing the CardActionArea and ButtonBase components from Material Ui @next for my application. Struggling to modify the onhover effect that accompanies the button. The selector responsible for the background overlay color on hover s ...