<p dir="auto">The code is extremely simple:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot; ng-app=&quot;app&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;/head&gt;
&lt;body ng-controller=&quot;TestController&quot;&gt;

    &lt;input type=&quot;text&quot; ng-model=&quot;state.addr&quot; ng-click=&quot;openDialog()&quot;&gt;

    &lt;script src=&quot;angular.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;app.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;"><pre class="notranslate"><span class="pl-c1">&lt;!DOCTYPE html<span class="pl-kos">&gt;</span></span>
<span class="pl-kos">&lt;</span><span class="pl-ent">html</span> <span class="pl-c1">lang</span>="<span class="pl-s">en</span>" <span class="pl-c1">ng-app</span>="<span class="pl-s">app</span>"<span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">head</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">meta</span> <span class="pl-c1">charset</span>="<span class="pl-s">UTF-8</span>"<span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">head</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">body</span> <span class="pl-c1">ng-controller</span>="<span class="pl-s">TestController</span>"<span class="pl-kos">&gt;</span>

    <span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">text</span>" <span class="pl-c1">ng-model</span>="<span class="pl-s">state.addr</span>" <span class="pl-c1">ng-click</span>="<span class="pl-s">openDialog()</span>"<span class="pl-kos">&gt;</span>

    <span class="pl-kos">&lt;</span><span class="pl-ent">script</span> <span class="pl-c1">src</span>="<span class="pl-s">angular.js</span>" <span class="pl-c1">charset</span>="<span class="pl-s">utf-8</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">script</span> <span class="pl-c1">src</span>="<span class="pl-s">app.js</span>" <span class="pl-c1">charset</span>="<span class="pl-s">utf-8</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">body</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">html</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto"><em>app.js</em></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var mainWindow = require('electron').remote.getCurrentWindow();
var dialog = require('electron').remote.require('dialog');

var app = angular.module('app', []);

app.controller('TestController', function($scope) {
    $scope.state = {};
    $scope.openDialog = function() {
        dialog.showOpenDialog(mainWindow, {
            title: 'open file',
            properties: [
                'openDirectory'
            ]
        }, function(files) {
            if (files &amp;&amp; files.length) {
                $scope.state.addr = files[0];
                $scope.$apply();
            }
        });
    };
});"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">mainWindow</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'electron'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">remote</span><span class="pl-kos">.</span><span class="pl-en">getCurrentWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">dialog</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'electron'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">remote</span><span class="pl-kos">.</span><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'dialog'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-s1">angular</span><span class="pl-kos">.</span><span class="pl-en">module</span><span class="pl-kos">(</span><span class="pl-s">'app'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">controller</span><span class="pl-kos">(</span><span class="pl-s">'TestController'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">$scope</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">$scope</span><span class="pl-kos">.</span><span class="pl-c1">state</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-s1">$scope</span><span class="pl-kos">.</span><span class="pl-en">openDialog</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">dialog</span><span class="pl-kos">.</span><span class="pl-en">showOpenDialog</span><span class="pl-kos">(</span><span class="pl-s1">mainWindow</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
            <span class="pl-c1">title</span>: <span class="pl-s">'open file'</span><span class="pl-kos">,</span>
            <span class="pl-c1">properties</span>: <span class="pl-kos">[</span>
                <span class="pl-s">'openDirectory'</span>
            <span class="pl-kos">]</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">files</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">files</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">files</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                <span class="pl-s1">$scope</span><span class="pl-kos">.</span><span class="pl-c1">state</span><span class="pl-kos">.</span><span class="pl-c1">addr</span> <span class="pl-c1">=</span> <span class="pl-s1">files</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
                <span class="pl-s1">$scope</span><span class="pl-kos">.</span><span class="pl-en">$apply</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">My expectation:</p>
<ol dir="auto">
<li>User can click in the <code class="notranslate">input</code> element, a <code class="notranslate">dialog</code> would be shown.</li>
<li>User can select a directory or just cancel the <code class="notranslate">dialog</code></li>
<li>The selected directory path will be placed in the <code class="notranslate">input</code> element.</li>
</ol>
<p dir="auto">But actually:</p>
<p dir="auto">Once i click the <code class="notranslate">input</code>, no matter i select a directory or cancel the <code class="notranslate">dialog</code>, following error occurs:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1059956/11417866/6606f630-9455-11e5-856d-ca6b9014f781.png"><img src="https://cloud.githubusercontent.com/assets/1059956/11417866/6606f630-9455-11e5-856d-ca6b9014f781.png" alt="snip20151126_2" style="max-width: 100%;"></a></p>
<p dir="auto">But the code works just perfect in <code class="notranslate">0.35.0</code>. This error gets hurt me while i upgraded to <code class="notranslate">0.35.1</code></p>
<p dir="auto">Hey folks—in Electron <code class="notranslate">0.34.3</code>, it was possible to do this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  showOpenDialog: (options, callback) -&gt;
    dialog = remote.require('dialog')
    dialog.showOpenDialog(@getCurrentWindow(), options, callback)"><pre class="notranslate"><code class="notranslate">  showOpenDialog: (options, callback) -&gt;
    dialog = remote.require('dialog')
    dialog.showOpenDialog(@getCurrentWindow(), options, callback)
</code></pre></div>
<p dir="auto">However, in <code class="notranslate">0.35.1</code>, the open dialog appears and the <code class="notranslate">callback</code> is run, but user interaction with the BrowserWindow fails in really strange way after you're finished selecting files. You can type into the selected text input and scroll, but you can't click anything on the page. As far as I can tell, it's permanently borked.</p>
<p dir="auto">On the other hand, using the synchronous version of showOpenDialog works just fine. This code does not exhibit the problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  showOpenDialog: (options, callback) -&gt;
    dialog = remote.require('dialog')
    callback(dialog.showOpenDialog(@getCurrentWindow(), options))"><pre class="notranslate"><code class="notranslate">  showOpenDialog: (options, callback) -&gt;
    dialog = remote.require('dialog')
    callback(dialog.showOpenDialog(@getCurrentWindow(), options))
</code></pre></div>
<p dir="auto">I know that passing callbacks through <code class="notranslate">remote</code> is "bad", but I feel like something else may be the issue here?</p>