Last modified: 2008-04-30 20:33:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T12642, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10642 - Shift-clicking checkboxes in Opera 9.2
Shift-clicking checkboxes in Opera 9.2
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.11.x
All All
: Normal normal (vote)
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-19 14:51 UTC by AlexSm
Modified: 2008-04-30 20:33 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Checkbox checked state during mouseUp event (199 bytes, text/html)
2007-07-19 14:51 UTC, AlexSm
Details

Description AlexSm 2007-07-19 14:51:38 UTC
Created attachment 3934 [details]
Checkbox checked state during mouseUp event

When you try using shift-clicking checkboxes in Opera 9.20, for example on http://en.wikipedia.org/w/index.php?title=Special:Watchlist&action=edit, it doesn't work properly like in other browsers.

Why: the code
 if ( is_opera ) { // opera has already toggled the checkbox by this point
   endState = !endState;
 }
in checkboxMouseupHandler() in  http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/wikibits.js 

What the comment says is not true, at least for Opera 9.2. Try attached example in Opera and Firefox/IE and behaviour is the same: mouseup event shows previous checkbox state.

Suggestion: determine which exactly old Opera versions behave incorrectly and modify the condition above.
Comment 1 Brion Vibber 2007-07-19 15:33:57 UTC
Fixed in r24272:

The previous code was using the 'onmouseup' event to trigger the shift-click multiple selection behavior. This had a number of problems:

* Opera 6.0 doesn't fire this event on radio buttons
* Opera 7.x and 8.x flip the check state before sending the event, while Opera 9.x and other browsers flip it after
* A UA check for Opera was used to work around the state inconsistency for 7.x and 8.x, which broke on 9.x
* Minor quibble: the event fires if you click outside the radio and release while the mouse is over it, though that wouldn't normally count as a click on the radio.

I've switched it to use the 'onclick' event handler instead, which resolves this:

* Opera 6.x fires this event
* All tested browsers have flipped the check state before the event, so special-case code can be removed.

Tested browsers:

* Opera 9.2, 9.0, 8.5, 8.0, 7.5, 6.0/Mac
* Firefox 2/Mac
* Safari 2/Mac
* Safari 3/Win
* IE 7/Win
* IE 6/Win
* IE 5.2/Mac
* iCab 3/Mac
* Mozilla 1.1/Mac
Comment 2 NicoV 2008-04-30 20:07:36 UTC
I think the bug fix introduced a side effect :

I have created an extension that can create checkboxes through Javascript with my on event handler for onclick(). With this fix, checkboxes don't work any more (no events). See http://wiki.jmol.org/index.php/Sandbox for an example

Could wikibits.js be modified again for only calling "cb.onclick = checkboxMouseupHandler" only when there's not already a handler for cb.onclick ?

Thanks in advance,
Nico
Comment 3 Brion Vibber 2008-04-30 20:33:44 UTC
Switching to adding an event handler hook instead of setting onclick explicitly would probably fix this...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links