Support scrollIntoView alignment options (#3952)
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
85b373deff
commit
28d38307a2
7 files changed
+79
-19
No files matched your search
@@ -79,12 +79,12 @@ impl RenderedElementBacking for DesktopElement {
|
||||
|
||||
fn scroll_to(
|
||||
&self,
|
||||
behavior: dioxus_html::ScrollBehavior,
|
||||
options: dioxus_html::ScrollToOptions,
|
||||
) -> std::pin::Pin<Box<dyn futures_util::Future<Output = dioxus_html::MountedResult<()>>>> {
|
||||
let script = format!(
|
||||
"return window.interpreter.scrollTo({}, {});",
|
||||
self.id.0,
|
||||
serde_json::to_string(&behavior).expect("Failed to serialize ScrollBehavior")
|
||||
serde_json::to_string(&options).expect("Failed to serialize ScrollToOptions")
|
||||
);
|
||||
let webview = self
|
||||
.webview
|
||||
|
||||
Reference in new issue
Block a user