Open cangSDARM opened 2 years ago
A less elegant solution from before
https://github.com/tauri-apps/tauri/pull/3031
Customize an event and allow tauri users to bind it themselves may better
See here for the reasons why we can't change it: https://github.com/tauri-apps/tauri/pull/3031. So yes you need to add the attribute to the actual click target (which generally should be the innermost element)
Edit: Unlucky timing 😂
See here for the reasons why we can't change it: tauri-apps/tauri#3031. So yes you need to add the attribute to the actual click target (which generally should be the innermost element)
I saw. So I suggest using a custom event to let the user bind himself
Customize an event and allow tauri users to bind it themselves may better
You can already do that by using startDragging
yourself.
Customize an event and allow tauri users to bind it themselves may better
You can already do that by using
startDragging
yourself.
It would be better to implement in tauri to avoid other potential bugs. Or give a hint in the documentation? 😂
It is documented here https://tauri.studio/docs/api/js/classes/window.WindowManager#startdragging
Yeah that guide needs to highlight data-tauri-drag-region
more and also include a manual implementation of it using window.startDragging
and mousedown
event.
Yeah that guide needs to highlight
data-tauri-drag-region
more and also include a manual implementation of it usingwindow.startDragging
andmousedown
event.
Suggestion noted
Not sure if this should be different issue or no but the search on the documentation site doesn't find anything with "drag", "dragging", or "data-tauri-drag-region" even though the string data-tauri-drag-region clearly is on this page: https://tauri.app/v1/guides/features/window-customization/
Is there something I could do to help improving the docs (or the search)?
The search is currently not nearly as optimized enough and basically only picks up headers right now :/ And code blocks will probably never be indexed, not sure
Is there something I could do to help improving the docs (or the search)?
We always appreciate PRs adding or rewriting guides, or improving the api docs. We know that all that is far from perfect.
The search itself is a spicy topic and still needs a lot of work :/
We'll be making a new recipe on the topic for 2.0 that hopefully addresses this, with best practises for the various platforms. Tracking this for 2.0.
Describe the bug
https://github.com/tauri-apps/tauri/blob/45d427e44c0e06194079426c2690019643e03277/core/tauri/scripts/core.js#L136
here is my dom hierarchy:
It renders like this:![image](https://user-images.githubusercontent.com/20441896/161040936-5078c945-9631-4b3d-a370-d6e1c8744180.png)
I can't properly trigger the window's drag unless I add
data-tauri-drag-region
to every element.Perhapes
Customize an event and allow tauri users to bind it themselves
Reproduction
No response
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response