Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/tauri-cli/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
]
},
"dragDropEnabled": {
"description": "Whether the drag and drop is enabled or not on the webview. By default it is enabled.\n\n Disabling it is required to use HTML5 drag and drop on the frontend on Windows.",
"description": "Whether the drag and drop handlers used internally to generate [`DragDropEvent`]s are enabled on the webview. By default it is enabled.\n\n Disabling it is required to use HTML5 drag and drop on the frontend on Windows since we replace the drag drop handler of WebView2.\n\n Note: this setting maps to [`WebviewBuilder::disable_drag_drop_handler`], not [`WindowBuilder::drag_and_drop`].\n\n [`DragDropEvent`]: https://docs.rs/tauri/latest/tauri/enum.DragDropEvent.html\n [`WebviewBuilder::disable_drag_drop_handler`]: https://docs.rs/tauri/latest/tauri/webview/struct.WebviewBuilder.html#method.disable_drag_drop_handler\n [`WindowBuilder::drag_and_drop`]: https://docs.rs/tauri/latest/x86_64-pc-windows-msvc/tauri/window/struct.WindowBuilder.html#method.drag_and_drop",
"default": true,
"type": "boolean"
},
Expand Down
4 changes: 3 additions & 1 deletion crates/tauri-runtime/src/webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,9 @@ impl WebviewAttributes {
self
}

/// Disables the drag and drop handler. This is required to use HTML5 drag and drop APIs on the frontend on Windows.
/// Disables the drag and drop handler used internally to generate [`DragDropEvent`](crate::window::DragDropEvent)s.
///
/// This is required to use HTML5 drag and drop APIs on the frontend on Windows since we replace the drag drop handler of WebView2.
#[must_use]
pub fn disable_drag_drop_handler(mut self) -> Self {
self.drag_drop_handler_enabled = false;
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-schema-generator/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
]
},
"dragDropEnabled": {
"description": "Whether the drag and drop is enabled or not on the webview. By default it is enabled.\n\n Disabling it is required to use HTML5 drag and drop on the frontend on Windows.",
"description": "Whether the drag and drop handlers used internally to generate [`DragDropEvent`]s are enabled on the webview. By default it is enabled.\n\n Disabling it is required to use HTML5 drag and drop on the frontend on Windows since we replace the drag drop handler of WebView2.\n\n Note: this setting maps to [`WebviewBuilder::disable_drag_drop_handler`], not [`WindowBuilder::drag_and_drop`].\n\n [`DragDropEvent`]: https://docs.rs/tauri/latest/tauri/enum.DragDropEvent.html\n [`WebviewBuilder::disable_drag_drop_handler`]: https://docs.rs/tauri/latest/tauri/webview/struct.WebviewBuilder.html#method.disable_drag_drop_handler\n [`WindowBuilder::drag_and_drop`]: https://docs.rs/tauri/latest/x86_64-pc-windows-msvc/tauri/window/struct.WindowBuilder.html#method.drag_and_drop",
"default": true,
"type": "boolean"
},
Expand Down
10 changes: 8 additions & 2 deletions crates/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1953,9 +1953,15 @@ pub struct WindowConfig {
/// The user agent for the webview
#[serde(alias = "user-agent")]
pub user_agent: Option<String>,
/// Whether the drag and drop is enabled or not on the webview. By default it is enabled.
/// Whether the drag and drop handlers used internally to generate [`DragDropEvent`]s are enabled on the webview. By default it is enabled.
///
/// Disabling it is required to use HTML5 drag and drop on the frontend on Windows.
/// Disabling it is required to use HTML5 drag and drop on the frontend on Windows since we replace the drag drop handler of WebView2.
///
/// Note: this setting maps to [`WebviewBuilder::disable_drag_drop_handler`], not [`WindowBuilder::drag_and_drop`].
///
/// [`DragDropEvent`]: https://docs.rs/tauri/latest/tauri/enum.DragDropEvent.html
/// [`WebviewBuilder::disable_drag_drop_handler`]: https://docs.rs/tauri/latest/tauri/webview/struct.WebviewBuilder.html#method.disable_drag_drop_handler
/// [`WindowBuilder::drag_and_drop`]: https://docs.rs/tauri/latest/x86_64-pc-windows-msvc/tauri/window/struct.WindowBuilder.html#method.drag_and_drop
#[serde(default = "default_true", alias = "drag-drop-enabled")]
pub drag_drop_enabled: bool,
/// Whether or not the window starts centered or not.
Expand Down
4 changes: 3 additions & 1 deletion crates/tauri/src/webview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,9 @@ fn main() {
self
}

/// Disables the drag and drop handler. This is required to use HTML5 drag and drop APIs on the frontend on Windows.
/// Disables the drag and drop handler used internally to generate [`DragDropEvent`](crate::DragDropEvent)s.
///
/// This is required to use HTML5 drag and drop APIs on the frontend on Windows since we replace the drag drop handler of WebView2.
#[must_use]
pub fn disable_drag_drop_handler(mut self) -> Self {
self.webview_attributes.drag_drop_handler_enabled = false;
Expand Down
8 changes: 6 additions & 2 deletions crates/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,9 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
self
}

/// Enables or disables drag and drop support.
/// Enables or disables drag and drop support of this window.
///
/// Note: this is a different config from [`Self::disable_drag_drop_handler`]
#[cfg(windows)]
#[must_use]
pub fn drag_and_drop(mut self, enabled: bool) -> Self {
Expand Down Expand Up @@ -1036,7 +1038,9 @@ impl<R: Runtime, M: Manager<R>> WebviewWindowBuilder<'_, R, M> {
self
}

/// Disables the drag and drop handler. This is required to use HTML5 drag and drop APIs on the frontend on Windows.
/// Disables the webview drag and drop handler used internally to generate [`DragDropEvent`](crate::DragDropEvent)s.
///
/// This is required to use HTML5 drag and drop APIs on the frontend on Windows since we replace the drag drop handler of WebView2.
#[must_use]
pub fn disable_drag_drop_handler(mut self) -> Self {
self.webview_builder = self.webview_builder.disable_drag_drop_handler();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
"prettier": "^3.8.1"
},
"minimumReleaseAge": 4320,
"packageManager": "pnpm@10.30.3"
"packageManager": "pnpm@11.13.0"
}
7 changes: 4 additions & 3 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ packages:
- examples/resources
- examples/file-associations

onlyBuiltDependencies:
- esbuild
- workerd
allowBuilds:
esbuild: true
sharp: true
workerd: true

overrides:
esbuild@>=0.27.3 <0.28.1: '>=0.28.1'
Expand Down
Loading