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

[docs] webviewWindow not working example #12836

Open
moritz-baecker-integra opened this issue Feb 27, 2025 · 4 comments
Open

[docs] webviewWindow not working example #12836

moritz-baecker-integra opened this issue Feb 27, 2025 · 4 comments
Labels
type: documentation Need to update the API documentation

Comments

@moritz-baecker-integra
Copy link

https://v2.tauri.app/reference/javascript/api/namespacewebviewwindow/

the shown example:

const appWindow = new Window('uniqueLabel');

// loading embedded asset:
const webview = new Webview(appWindow, 'theUniqueLabel', {
  url: 'path/to/page.html'
});

is not valid, since the properties object is not valid.

Argument of type '{ url: string; }' is not assignable to parameter of type 'WebviewOptions'.
Type '{ url: string; }' is missing the following properties from type 'WebviewOptions': x, y, width, height

either the type is wrong, or the documentation.

@moritz-baecker-integra moritz-baecker-integra added the type: documentation Need to update the API documentation label Feb 27, 2025
@FabianLars
Copy link
Member

FabianLars commented Feb 27, 2025

the real issue here is that this example is not supposed to be there. The webviewWindow docs should not show the use of the Window and Webview objects but only WebviewWindow.

This is the correct example https://v2.tauri.app/reference/javascript/api/namespacewebviewwindow/#example-1

@moritz-baecker-integra
Copy link
Author

Alright thanks. Still leaves the problem for the other doc pages with the same example.
https://v2.tauri.app/reference/javascript/api/namespacewebview/

@moritz-baecker-integra
Copy link
Author

moritz-baecker-integra commented Feb 27, 2025

It also doesn't seem to be correct, that there is a tauri://created or its missing in the enum

Image

Image

@FabianLars
Copy link
Member

Still leaves the problem for the other doc pages with the same example.

yep

It also doesn't seem to be correct, that there is a tauri://created or its missing in the enum

it still exists but has some special handling apparently. it can be added back to the enum as WEBVIEW_WINDOW_CREATED for example.

thanks for bringing all that to our attention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation Need to update the API documentation
Projects
None yet
Development

No branches or pull requests

2 participants