Last modified: 2014-11-12 20:52:31 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 T56019, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54019 - jQuery.wikibase.***view widgets "startEditing" should not be smart about focus
jQuery.wikibase.***view widgets "startEditing" should not be smart about focus
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=frontend p=0
: javascript
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-11 16:40 UTC by Daniel A. R. Werner
Modified: 2014-11-12 20:52 UTC (History)
6 users (show)

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


Attachments

Description Daniel A. R. Werner 2013-09-11 16:40:49 UTC
The jQuery.wikibase.***view widgets (.e.g "valueview") should not be as "smart" about the focus when switching into edit mode as they currently are.

Currently when calling "startEditing", the focus will be set for one of the generated input fields. This is bad because when instantiating several view widgets and programmatically setting all of them into edit mode at the same time, then the "startediting" event (as well as "focus"/"blur") will be triggered for all of them since the focus will be set for each of them, one after the other. At the end, the last of them will be focused. This is for example a problem in the claimview, where the snakview is used for each qualifier + main snak, when clicking "edit", startEditing will be called for each snak's snakview).
Instead of setting the focus from within each widget, the respective controller code should set the focus if required.

Also, when instantiating the widget, it is a bad idea to only start the edit mode conditionally in the case the initially represented value is null. We already introduced a "autoStartEditing" option which can be set to false, but this should actually be the default behavior for any new widgets.

Having a "focus" and "blur" function on those widgets would probably be a good idea, otherwise the "internal" DOM structure had to be searched for input forms to focus/blur by the caller.
Comment 1 Henning 2014-11-06 16:35:08 UTC
https://gerrit.wikimedia.org/r/#/c/171555/
Comment 2 Gerrit Notification Bot 2014-11-11 10:20:13 UTC
Change 171555 had a related patch set uploaded by Thiemo Mättig (WMDE):
Removed focus smartness from snakview

https://gerrit.wikimedia.org/r/171555
Comment 3 Gerrit Notification Bot 2014-11-12 18:45:16 UTC
Change 171555 merged by jenkins-bot:
Removed focus smartness from snakview

https://gerrit.wikimedia.org/r/171555

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


Navigation
Links