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

fix(api.js): expose fileDropEnabled in WebviewWindow constructor #2968

Closed
wesin opened this issue Nov 26, 2021 · 1 comment
Closed

fix(api.js): expose fileDropEnabled in WebviewWindow constructor #2968

wesin opened this issue Nov 26, 2021 · 1 comment
Labels
good first issue Good for newcomers priority: 2 medium scope: api.js The @tauri-apps/api npm package type: bug

Comments

@wesin
Copy link

wesin commented Nov 26, 2021

when i create a new WebviewWindow. the h5 drag & drop is not supported

    const webview = new WebviewWindow(e.id, {
      url: '/#/expDesign',
      center: true,
      title: e.name,
    });
    webview.once('tauri://created', function () {
      console.log('new window');
    });

but if i use navigate the page it works.

  const openWebUrl = () => {
    navigate('/expDesign');
  };

so maybe thie fileDropEnabled is not suppert the multiwindos.

but my destination is to create a new WebviewWindow.
i have set the fileDropEnabled:fase in the tauri.conf.json

my enviroment is

  • win10
  • "react": "^17.0.2",
  • "@tauri-apps/api": "^1.0.0-beta.8",
@FabianLars
Copy link
Member

i have set the fileDropEnabled:fase in the tauri.conf.json

Actually, no you didn't. This property is set on a per-window basis, which means you'd have to set it inside the WebviewWindow constructor, but this property is indeed not exposed in JavaScript at the moment.
A workaround would be to create the window in rust where file_drop_enabled is available on the WebviewAttributes struct.
But it's a good idea to make this possible in JavaScript too, so I guess we'll change that (if possible).

@amrbashir amrbashir added scope: api.js The @tauri-apps/api npm package good first issue Good for newcomers priority: 2 medium labels Nov 26, 2021
@amrbashir amrbashir changed the title new WebviewWindow created then the view can not support H5 drag & drop fix(api.js): expose fileDropEnabled in WebviewWindow constructor Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers priority: 2 medium scope: api.js The @tauri-apps/api npm package type: bug
Projects
None yet
Development

No branches or pull requests

3 participants