Not working Dropdown and Popup (bootstrap) #488

Closed
opened 2026-01-29 16:40:59 +00:00 by claunia · 2 comments
Owner

Originally created by @graylobo on GitHub (May 14, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: 8.31.2
  • Target: window

I make some Blazor page. github code link is below
https://github.com/graylobo/BlazorElectron
20200514_181350

If I run it in browser, dropdown effect and popup effect work's good,
but if I run it in Electron.net, it doesn't work
20200514_181903

Can I fix this problem?

Originally created by @graylobo on GitHub (May 14, 2020). Originally assigned to: @GregorBiswanger on GitHub. <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 8.31.2 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> <!-- What target are you building for? --> * **Target**: window <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> I make some Blazor page. github code link is below https://github.com/graylobo/BlazorElectron ![20200514_181350](https://user-images.githubusercontent.com/37823841/81916423-c2323400-960e-11ea-9344-09f4c90f48e3.png) If I run it in browser, dropdown effect and popup effect work's good, but if I run it in Electron.net, it doesn't work ![20200514_181903](https://user-images.githubusercontent.com/37823841/81916891-69af6680-960f-11ea-9019-03f4609602cb.png) Can I fix this problem?
claunia added the question label 2026-01-29 16:40:59 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (May 15, 2020):

Electron cannot find your jQuery instance.

image

To do this, you have to deactivate the node integration. This automatically changes everything to CommonJS. Important! If it is deactivated, you cannot use Electron.NET IPC communication. Then please use the standard communication from Blazor with your C# code.

Start without node integration:

Task.Run(async () => {
    var browserWindowOptions = new BrowserWindowOptions
    {
        WebPreferences = new WebPreferences
        {
            NodeIntegration = false
        }
    };
    await Electron.WindowManager.CreateWindowAsync(browserWindowOptions);
});

Then it works:

electron-net-blazor-jquery

@GregorBiswanger commented on GitHub (May 15, 2020): Electron cannot find your jQuery instance. ![image](https://user-images.githubusercontent.com/7336300/82092146-fda92d00-96f8-11ea-8966-5bc59ab4f734.png) To do this, you have to deactivate the node integration. This automatically changes everything to CommonJS. **Important!** If it is deactivated, you cannot use Electron.NET IPC communication. Then please use the standard communication from Blazor with your C# code. **Start without node integration:** ``` Task.Run(async () => { var browserWindowOptions = new BrowserWindowOptions { WebPreferences = new WebPreferences { NodeIntegration = false } }; await Electron.WindowManager.CreateWindowAsync(browserWindowOptions); }); ``` **Then it works:** ![electron-net-blazor-jquery](https://user-images.githubusercontent.com/7336300/82092349-67293b80-96f9-11ea-88de-081e5f0479f7.gif)
Author
Owner

@romuloteixeira commented on GitHub (May 10, 2021):

Hi,
I used this solution and worked for me.
https://github.com/ElectronNET/Electron.NET/issues/329#issuecomment-546612899

Example:
image

@romuloteixeira commented on GitHub (May 10, 2021): Hi, I used this solution and worked for me. [https://github.com/ElectronNET/Electron.NET/issues/329#issuecomment-546612899](url) Example: ![image](https://user-images.githubusercontent.com/40904138/117655311-ce53c180-b18e-11eb-8697-58458ebc7509.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#488