Page MenuHomePhabricator

When opening the dialog from a suggestion, the focus should be in the target title field
Closed, ResolvedPublic1 Estimated 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)
Amire80 triaged this task as Medium 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.

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();
+               }
        };
 
        /**

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

Verified. Working as expected.