Last modified: 2011-03-13 18:05:09 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 T22498, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20498 - wikEd compatibility: toolbar focuses on hidden textarea
wikEd compatibility: toolbar focuses on hidden textarea
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
UsabilityInitiative (Other open bugs)
unspecified
All All
: Lowest normal (vote)
: ---
Assigned To: Trevor Parscal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-04 03:10 UTC by Cacycle
Modified: 2011-03-13 18:05 UTC (History)
2 users (show)

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


Attachments

Description Cacycle 2009-09-04 03:10:19 UTC
The editing toolbar (or another new component) seems to set focus on the textarea (or a related element) even if the standard textarea is hidden and the wikEd editing iframe is in place. Any focusing should only be done if the textarea is not hidden (style.display != 'none').
Comment 1 Cacycle 2009-09-04 03:12:18 UTC
Focusing happens shortly after page load and after pushing the toolbar edit buttons. See also Bug 20134.
Comment 2 Cacycle 2009-09-09 03:23:30 UTC
The toolbar also steals the focus after clicking any wikEd button! People are already complaining about this issue on the wikEd bug page and it is a major compatibility problem.
Comment 3 Roan Kattouw 2009-09-09 11:53:39 UTC
Would it be very difficult to hook into and block the textarea focus event? Like:

$('#wpTextbox1').focus( function(e) {
        e.preventDefault(); // Don't actually focus
        // Maybe do more stuff here
});
Comment 4 Cacycle 2009-09-09 12:45:45 UTC
As for focusing in general, I think it would be a cleaner solution to manage this in the toolbar code, e.g. as a wrapper for .focus() that checks if the focus target (the textbox) is visible (.display!="none").

For the second issue: For compatibility reasons with gadgets, the toolbar must not add any events to buttons other than its own. 
Comment 5 Roan Kattouw 2009-09-09 12:50:16 UTC
(In reply to comment #4)
> As for focusing in general, I think it would be a cleaner solution to manage
> this in the toolbar code, e.g. as a wrapper for .focus() that checks if the
> focus target (the textbox) is visible (.display!="none").
> 
That sounds like a good idea.

> For the second issue: For compatibility reasons with gadgets, the toolbar must
> not add any events to buttons other than its own. 
> 
Could you explain how this is relevant? I don't see it.
Comment 6 Cacycle 2009-09-09 13:16:53 UTC
The toolbar seems to add events to buttons that do not belong to it (like all wikEd buttons and probably also of other gadgets and user scripts). The toolbar must only add events to its own buttons.
Comment 7 Cacycle 2009-09-09 13:35:00 UTC
wikEd rearranges the toolbar as well as the textarea into div wrappers. The toolbar might need a more robust method to determine which buttons belong to itself and not to other application.
Comment 8 Roan Kattouw 2009-09-10 12:29:54 UTC
(In reply to comment #6)
> The toolbar seems to add events to buttons that do not belong to it (like all
> wikEd buttons and probably also of other gadgets and user scripts). The toolbar
> must only add events to its own buttons.
> 

(In reply to comment #7)
> wikEd rearranges the toolbar as well as the textarea into div wrappers. The
> toolbar might need a more robust method to determine which buttons belong to
> itself and not to other application.
> 

The toolbar only adds events to buttons as it adds them, it doesn't do anything like 'add this event to all buttons that are children of children of this div'. I'll play around with wikEd a bit later and I'll try to figure out what's going on.
Comment 9 Cacycle 2009-09-10 13:33:26 UTC
Thanks for looking into this. If you click any wikEd button, the textarea (or something else) gets focused as indicated by a giant blinking caret on the right side of the edit area (supposedly the hidden textarea or an element focused instead). Surprisingly, this behaviour disappears after pushing the local preview or the local diff buttons next to the submit and preview buttons. The problem happens only with the enhanced toolbar running. I have just checked the wikEd focusing code and it looks robust to me.
Comment 10 Roan Kattouw 2009-09-17 20:08:34 UTC
Works OK for me, maybe the code update magically fixed it. Can you verify this?
Comment 11 Cacycle 2009-09-18 00:15:01 UTC
I cannot verify this because the enhanced toolbar has disappeared! It is no longer available from the preferences or by clicking the beta test link.
Comment 12 Roan Kattouw 2009-09-18 13:21:42 UTC
(In reply to comment #11)
> I cannot verify this because the enhanced toolbar has disappeared! It is no
> longer available from the preferences or by clicking the beta test link.
> 

It was temporarily disabled because it blew up on IE8 (see bug 20668); it's back now.
Comment 13 Cacycle 2009-09-19 03:17:05 UTC
The problem still exists. You can replicate it by pushing the wikEd regexp button. It can also be seen after pushing the standard Submit/Preview/Diff buttons before the new page loads.
Comment 14 Roan Kattouw 2009-09-22 15:50:20 UTC
(In reply to comment #13)
> The problem still exists. You can replicate it by pushing the wikEd regexp
> button.
That behaves the same way with and without the toolbar for me.

> It can also be seen after pushing the standard Submit/Preview/Diff
> buttons before the new page loads.
> 
What do you mean by "before the new page loads"?
Comment 15 Cacycle 2009-09-27 01:50:37 UTC
With the enhanced toolbar enabled, pushing the wikEd regexp button in Firefox 3.5.3 focuses the document. This lets the caret start blinking wherever it was positioned before. For me the default position is under the edit are, right before the "Content that violates any copyrights will be deleted..." element. This focusing does not happen with the enhanced toolbar disabled.

The toolbar should not focus the document or any other document element when wikEd runs, especially (but not restricted to) after pushing buttons not belonging to it. wikEd sets the focus to its own iframe document after processing wikEd buttons.

Re "before the new page loads": after pushing the submit or preview buttons and before the current page disappears and the new page loads, you can see the exact same focusing phenomenon for a moment.
Comment 16 Roan Kattouw 2009-09-27 12:30:44 UTC
(In reply to comment #15)
> With the enhanced toolbar enabled, pushing the wikEd regexp button in Firefox
> 3.5.3 focuses the document. This lets the caret start blinking wherever it was
> positioned before. For me the default position is under the edit are, right
> before the "Content that violates any copyrights will be deleted..." element.
> This focusing does not happen with the enhanced toolbar disabled.
> 
It does for me:
* Go edit a page with wikEd enabled and the enhanced toolbar disabled
* Type the following in the Firebug console: $j(document).focus(function(e){console.log(e);});
* Click in the textarea
* Click the regex button
* The console outputs Object originalEvent=Event focus type=focus
Comment 17 Cacycle 2009-09-27 16:51:04 UTC
I am not sure what that means or implicates :-)
Comment 18 Roan Kattouw 2009-09-27 17:31:49 UTC
(In reply to comment #17)
> I am not sure what that means or implicates :-)
> 

$j(document).focus(function(e){console.log(e);}); means: whenever the document received a focus event, log the event object to the Firebug console. Upon clicking the regex buttons, two log lines corresponding to focus event objects appear in the console, which means that clicking the regex button somehow causes a focus on the document even though the enhanced toolbar isn't enabled.

Note that this requires viewing the edit form with Vector and having EditWarning enabled, otherwise jQuery won't be loaded and $j won't be defined.
Comment 19 Trevor Parscal 2010-02-16 21:32:29 UTC
At this time, we are not planning on dedicating resources to attaining/maintaining compatibility with the wikEd gadget.

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


Navigation
Links