Skip to content
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

[tree view] Ordering does not work on Macos - WebKit through the WKWebView #15411

Closed
abarrafo opened this issue Nov 14, 2024 · 12 comments
Closed
Labels
bug 🐛 Something doesn't work component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! external dependency Blocked by external dependency, we can’t do anything about it support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@abarrafo
Copy link

abarrafo commented Nov 14, 2024

Steps to reproduce

Steps:

  1. Open this link to an example project, you'll need to pull down and run: https://github.com/bookcicle/mui-tauri-drag-n-drop-tree-example
  2. Run the App on Macos
  3. No ordering

Current behavior

Works as expected on Linux, Works in Safari (you can follow the node server to use the browser to interact), but does not work on desktop environment... which I think runs on Webkit on macos.

Attached:

WhatsApp.Video.2024-11-14.at.8.57.13.AM.mp4

Expected behavior

Ordering should work on Desktop WebDriver Environments for Macos, Linux, and Windows? Honestly im not certain this falls under your support model?

Context

We are building a desktop app for Macos, Linux, and Windows running on tauri with a Rust back end and a React + MUI frontend.

Your environment

System: OS: macOS 15.1 Binaries: Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm pnpm: Not Found Browsers: Chrome: 130.0.6723.117 Edge: Not Found Safari: 18.1 npmPackages: @emotion/react: ^11.13.3 => 11.13.3 @emotion/styled: ^11.13.0 => 11.13.0 @mui/core-downloads-tracker: 6.1.7 @mui/material: ^6.1.7 => 6.1.7 @mui/private-theming: 6.1.7 @mui/styled-engine: 6.1.7 @mui/system: 6.1.7 @mui/types: 7.2.19 @mui/utils: 6.1.7 @mui/x-internals: 7.21.0 @mui/x-license: 7.21.0 @mui/x-tree-view: ^7.22.1 => 7.22.1 @mui/x-tree-view-pro: ^7.22.1 => 7.22.1 @types/react: 18.3.12 react: ^18.2.0 => 18.3.1 react-dom: ^18.2.0 => 18.3.1

Search keywords: Tree Ordering MacOs WebDriver
Order ID: 101655

@abarrafo abarrafo added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 14, 2024
@github-actions github-actions bot added component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Nov 14, 2024
@michelengelen
Copy link
Member

Hey @abarrafo ... it works for me ... Could you tell me if you run it in a specific mode or so... any detail helps

Screen.Recording.2024-11-14.at.15.39.54.mov

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 14, 2024
@michelengelen michelengelen changed the title Tree View Ordering does not work on Macos - WebKit through the WKWebView [tree view] Ordering does not work on Macos - WebKit through the WKWebView Nov 14, 2024
@abarrafo
Copy link
Author

abarrafo commented Nov 14, 2024

@michelengelen Yes, it works on the web page... Not on the desktop app.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Nov 14, 2024
@abarrafo
Copy link
Author

npm run tauri dev should start a desktop app for you, which they run through webview/webdrivers. Chromium for Linux and Windows ( I think). And Webkit for macos (which is the base for Safari). It does work on safari or web browsers when navigating there directly.

@abarrafo
Copy link
Author

My suspicion is you dont have cargo and rust setup? Thus your only running the npm dev server?

@abarrafo
Copy link
Author

abarrafo commented Nov 14, 2024

I'm fairly sure its a limitation of the underlying Webkit (20619.2.8.11.10 is mine) that does not support some browser feature your are relying on.

@michelengelen
Copy link
Member

My suspicion is you dont have cargo and rust setup? Thus your only running the npm dev server?

Yes, i typically do not do that ... seems like this is a very specialized setup. I'll ask around in the team if anyone is familiar with it. If not I'll install the minimal setup for it. 👍🏼

@michelengelen
Copy link
Member

Hey @abarrafo ... I did not have the time to install it yet, but did have a look in the bugtracker and it seems just recently there have been problems with the dropEffect in webkit browsers as well: Bug ticket 1 and Bug ticket 2

Could you try updating the webkit and try again? That would ideally already rule it out on our end. 👍🏼

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 26, 2024
@abarrafo
Copy link
Author

Webkit versions are tied tightly to MacOs releases. I did update my MacOs for testing this to the latest developer beta, which bumped my webkit version from 20619.2.8.11.12 -> 20620.1.16.11.6

Results are the same. I did test out react-arborist, which had similar buggy behavior.

@dnd-kit works in another case though without issue for drag-n-drop. I might give wrapping my tree nodes for MacOs in a dnd-kit context and handling it there on my own. But, not sure I will have time to get around to that for a bit.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Nov 27, 2024
@michelengelen
Copy link
Member

Considering that the other packages also have a bugged behavior I would say this is an issue with webkit and their implementation of the HTML drag and drop API.

It makes sense that dnd-kit works as well as they state in their docs ...

Unlike many drag and drop libraries, dnd kit is intentionally not built on top of the HTML5 Drag and drop API.

To support this we would need to rewrite the whole logic and that's out of the question. I hope you can understand that. Maybe you could open a ticket on their bugtracker to raise awareness?

I'll close this as an external bug for now, but will tag @LukasTy to see if he has an idea how we could approach this.

@michelengelen michelengelen added external dependency Blocked by external dependency, we can’t do anything about it and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@abarrafo How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@LukasTy
Copy link
Member

LukasTy commented Dec 2, 2024

Hello @abarrafo, I have found this relevant issue: tauri-apps/tauri#6695.
Based on it I added the following entry in the tauri.conf.json and the drag and drop behavior started working. 👌

"dragDropEnabled": false

@abarrafo
Copy link
Author

abarrafo commented Dec 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! external dependency Blocked by external dependency, we can’t do anything about it support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

No branches or pull requests

3 participants