Closed Bug 1106812 Opened 10 years ago Closed 10 years ago

Behaviour of select when having an option hat is disabled and selected is weird

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 346043

People

(Reporter: thedestiny, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36

Steps to reproduce:

I wrote a simple HTML case : a select element having options, and some of them are disabled. One of the disabled option is also selected.

I made a fiddle to reproduce the problem easily :
http://jsfiddle.net/pk93xg8m/2/

Drop the options down, then highlight one by putting your cursor over it, and finally click outside the component. Nothing change. 

Lose the focus.

(Reproduced with FF 33 and 34 but not with IE7/8 and Chrome)


Actual results:

The "onChange" event is triggered (focus lost).

The option shown by the select element did not change, but when you retrieve the value via javascript using "element.value", you get the value of the option you highlighted before.




Expected results:

The option shown should be equal to the "element.value".


The real question is, which value must be taken in consideration? In my opinion, clicking outside the component should not change the value (behaviour of the other browsers).
I can reproduce the bug on Linux in v35 but not v36/v37, so it might be fixed now.

Can you try a Nightly build on Windows please and let me know if it still occurs?
http://nightly.mozilla.org/

That is, are both the displayed value and element.value equal to "February"
after losing focus?  And no 'change' event should be dispatched so you might
want to check the value by clicking a separate button or something.

(ignore that you need to click twice to make it lose focus, that's bug 1106824)
Flags: needinfo?(thedestiny)
(I suspect it might be a dupe of bug 346043 which was fixed in v36.)
You're right, it's a dupe of bug 346043 and it's fixed in v36.
Thank you and sorry =)


(Options cannot be disabled anymore in v37 so i was not able to reproduce the case.)
Flags: needinfo?(thedestiny)
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
(In reply to Sébastien M. from comment #3)
> You're right, it's a dupe of bug 346043 and it's fixed in v36.
> Thank you and sorry =)

No problem, thank you for the report!

> (Options cannot be disabled anymore in v37 so i was not able to reproduce
> the case.)

I think that's a known e10s problem.  It should work if you disable it and restart
(under Preferences -> General).
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: