New issue
Advanced search Search tips

Issue 685955 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

selectbox onfocus="this.blur();" doesn't work as expected

Reported by ilise...@gmail.com, Jan 27 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Steps to reproduce the problem:
<select name="foo" onfocus="this.blur();"><option>1</option><option>2</option></select>

What is the expected behavior?
The user should not be able to open the select box.

What went wrong?
The user can expand the select box and select any of the options.

Did this work before? N/A 

Chrome version: <Copy from: 'about:version'>  Channel: n/a
OS Version: 55.0.2883.87 (Official Build) (64-bit)
Flash Version: Shockwave Flash 11.2 r202

If you are tempted to check the behavior of firefox, I can tell you that it works as expected.
However new firefox versions >~50 (with multiprocess feature enabled), are having problems too (open bug 1334155, under investigation).
 
Labels: Needs-Milestone

Comment 2 by tkent@chromium.org, Jan 27 2017

Components: -Blink Blink>Forms>Select
Why don't you just use 'disabled' attribute to disable a popup menu?

Comment 3 by ilise...@gmail.com, Jan 27 2017

Unfortunately, 'disable' option doesn't post the value at all.
I know that there are workarounds like adding a hidden field and copying the values to that, but that's another discussion.

The onfocus="this.blur();" solution works with firefox and it's a very simple solution to implement a "readonly" feature (along with a css to fade the element).

The thing is why it doesn't work on your browser and if it's a bug, it would be nice to fix it.

Comment 4 by tkent@chromium.org, Jan 30 2017

Status: WontFix (was: Unconfirmed)
For now, none of Chrome, Edge, Firefox, and Safari works as your expectation in this case, and the HTML standard doesn't define a behavior around this.  So, I don't think we should change the behavior.

preventDefault() for mousedown or click should work.

Also, can you propose to add 'readonly' attribute to <select> on https://github.com/whatwg/html/issues ?

Comment 5 Deleted

Sign in to add a comment