question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select/option doesn't work in chrome 53 after inspect

See original GitHub issue

Short description of the problem:

Select/option doesn’t work in chrome 53 after inspect.

What behavior are you expecting?

Open select box and see options list. Instead nothing happens. This issue happens only on chrome 53 desktop.

Steps to reproduce:

  1. Open Chrome and navigate to localhost:8100 after ionic serve
  2. Right click anywhere -> inspect element -> select any device
  3. Be sure to be on a page with a select box. Example:
controller.js
...
$scope.data = {}
$scope.data.list = ['1', '2', '3'];
$scope.data.selected = $scope.data.list[0];


view.html
            <ion-input class="item item-select text-align-left">
                <select
                        ng-options="value for value in data.list"
                        ng-model="data.selected">
                </select>
            </ion-input>

Which Ionic Version? 1.x or 2.x 1.3.1

Run ionic info from terminal/cmd prompt: (paste output below) Your system information:

Cordova CLI: 6.1.1 Gulp version: CLI version 1.2.1 Gulp local: Local version 3.9.1 Ionic CLI Version: 1.7.16 Ionic App Lib Version: 0.7.3 ios-deploy version: 1.8.5 ios-sim version: 5.0.6 OS: Mac OS X El Capitan Node Version: v5.6.0 Xcode version: Xcode 7.3.1 Build version 7D1014

Plunker that shows an example of your issue

http://plnkr.co/edit/Ph9G7pDcPtHV6PWvEq4U?p=preview

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
washington-guedescommented, Sep 8, 2016

Using version 52 of chrome it works, but throws this warn:

A DOM event generated from JavaScript has triggered a default action inside the browser. This behavior is non-standard and will be removed in M53, around September 2016. See https://www.chromestatus.com/features/5718803933560832 for more details.

My chrome updated today to version 53 and the select stopped working. The warn above also stopped.

I updated my ionic app and the select is still broken. Before updating ionic, the warn was caused by line 2865:

function triggerMouseEvent(type, ele, x, y) {
  var clickEvent = document.createEvent("MouseEvents");
  clickEvent.initMouseEvent(type, true, true, window, 1, 0, 0, x, y, false, false, false, false, 0, null);
  clickEvent.isIonicTap = true;
  ele.dispatchEvent(clickEvent); // (line 2865)
}

I don’t think it is a Chrome DevTools bug. It seems to be a problem with dispatchEvent action. I’m looking for a solution to this too.

4reactions
asim-qbcommented, Sep 22, 2016

Nope. I think issue is still there.

Some more info I’ve found:

  1. initMouseEvent is deprecated(Ref)
  2. It was possible to open a select element through JS earlier. Not anymore, (after Chrome 53 update) Quoting from the feature change page:

We wish to prevent synthetic events from executing the default action, aligning with Firefox and IE.

  1. Ionic is creating synthetic event for touch inputs on select (?) that’s why issue is seen on developer tools and native devices only.

@jgw96 Can you please re-open the issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select/option doesn't work in chrome 53 after inspect #8006
Open Chrome and navigate to localhost:8100 after ionic serve; Right click anywhere -> inspect element -> select any device; Be sure to be...
Read more >
Inspecting drop down menus in new Chrome - Stack Overflow
Hover over the element with your mouse and press F8 (this will only work in Chrome) to pause the script execution. The hover...
Read more >
Chrome Devtools Not Working With The Select Element - ADocLib
Short description of the problem: Select/option doesn't work in chrome 53 after inspect. What behavior are you expecting? Open select box.
Read more >
How to Inspect Element: Simple Methods for Editing a Web Page
Open Google Chrome and go to a website. In this example, we're using hostinger.com. Right-click anywhere on the web page and select Inspect...
Read more >
HTMLSelectElement add ability to show option list ... - WICG
Problem: The ability to open a HTMLSelectElement's option list from javascript doesn't exist. Some of the solutions used currently with Chrome won't work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found