Page MenuHomePhabricator

When opening the dialog from a suggestion, the focus should be in the target title field
Closed, ResolvedPublic1 Story Points

Description

Currently, if I select suggestion A, the new translation dialog opens with the text cursor in the source field (which results on the autocompletion article list to be displayed). Since it is unlikely that the user will change the article to translate right after selecting the suggestion, it is better to move to the input to the next field.

Event Timeline

Pginer-WMF raised the priority of this task from to Needs Triage.
Pginer-WMF updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 22 2015, 6:43 AM
Amire80 triaged this task as Normal priority.Oct 1 2015, 4:39 PM
Amire80 set Security to None.
Amire80 moved this task from Needs Triage to CX7 on the ContentTranslation board.
Amire80 edited a custom field.Oct 24 2015, 12:48 PM
Amire80 claimed this task.Oct 26 2015, 11:30 AM
Amire80 moved this task from Backlog to In Progress on the LE-CX7-Sprint 2 board.

Change 248864 had a related patch set uploaded (by Amire80):
WIP: Focus on the target field when opening a suggestion

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

@Amire80, what do you think about this simple patch?

diff --git a/modules/source/ext.cx.source.selector.js b/modules/source/ext.cx.source.selector.js
index 63d4dcb..541b092 100644
--- a/modules/source/ext.cx.source.selector.js
+++ b/modules/source/ext.cx.source.selector.js
@@ -93,11 +93,11 @@
                }
 
                if ( this.options.sourceTitle ) {
-                       this.$sourceTitleInput.val( this.options.sourceTitle ).trigger( 'input' );
+                       this.$sourceTitleInput.val( this.options.sourceTitle );
                }
 
                if ( this.options.targetTitle ) {
-                       this.$targetTitleInput.val( this.options.targetTitle ).trigger( 'input' );
+                       this.$targetTitleInput.val( this.options.targetTitle );
                }
 
                // If all of the values are already present,
@@ -627,7 +627,11 @@
                        this.showAsDialog();
                }
 
-               this.$sourceTitleInput.focus();
+               if ( !this.options.sourceTitle ) {
+                       this.$sourceTitleInput.focus();
+               } else {
+                       this.$targetTitleInput.focus();
+               }
        };
 
        /**
KuboF removed a subscriber: KuboF.Oct 29 2015, 11:49 PM

Change 248864 abandoned by Amire80:
Focus on the target field when opening a suggestion

Reason:
Will be done differently.

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

Change 250509 had a related patch set uploaded (by Amire80):
In the page selector, focus on the target title if the source title is prefilled

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

Change 250509 merged by jenkins-bot:
In the page selector, focus on the target title if the source title is prefilled

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

Amire80 moved this task from In Review to QA on the LE-CX7-Sprint 2 board.Nov 3 2015, 6:34 AM
Arrbee added a subscriber: Arrbee.Nov 3 2015, 4:15 PM

Verified. Working as expected.

Arrbee moved this task from QA to Done on the LE-CX7-Sprint 2 board.Nov 3 2015, 4:15 PM
santhosh closed this task as Resolved.Nov 3 2015, 7:27 PM