https://bugzilla.wikimedia.org/show_bug.cgi?id=54019
Web browser: ---
Bug ID: 54019
Summary: jQuery.wikibase.***view widgets "startEditing" should
not be smart about focus
Product: MediaWiki extensions
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: WikidataRepo
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Mobile Platform: ---
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l