Last modified: 2014-11-12 20:52:31 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.
https://gerrit.wikimedia.org/r/#/c/171555/
Change 171555 had a related patch set uploaded by Thiemo Mättig (WMDE): Removed focus smartness from snakview https://gerrit.wikimedia.org/r/171555
Change 171555 merged by jenkins-bot: Removed focus smartness from snakview https://gerrit.wikimedia.org/r/171555