Page MenuHomePhabricator

Keep input focus when switching from VE to wikitext editing
Closed, ResolvedPublic1 Estimated Story Points

Description

When the user switches between rich text and wikitext in an input area on flow, the input area should remain active so that the user can keep typing. Currently this is not happening when changing from VE to wikitext (it works the other way around).

Switching the editing mode should always move the input focus back to the text area.

UPDATED:
The cursor should be at the end of the existing text, not the beginning -- the purpose is to keep typing, without another click.

Event Timeline

Pginer-WMF raised the priority of this task from to High.
Pginer-WMF raised the priority of this task from High to Needs Triage.
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF removed a project: Design.
Pginer-WMF set Security to None.
DannyH triaged this task as Medium priority.Apr 27 2015, 4:51 PM
DannyH moved this task from Untriaged to Team discussion on the Collaboration-Team-Triage board.

Change 220665 had a related patch set uploaded (by Catrope):
Create an OOUI editor widget

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

Change 220665 merged by jenkins-bot:
Create an OOUI editor widget

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

Mooeypoo subscribed.

This should be fixed now.

Currently, switching

  • from wikitext to VE: the cursor is moved to the beginning of the line where the cursor was positioned
  • from VE to wikitext: the focus is lost

Change 231310 had a related patch set uploaded (by Mooeypoo):
Focus the editor on switch

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

Change 231405 had a related patch set uploaded (by Catrope):
Fix editor focusing issues

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

Change 231310 abandoned by Mooeypoo:
Focus the editor on switch

Reason:
Fixed in another commit

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

Change 231405 merged by jenkins-bot:
Fix editor focusing issues

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

To confirm that it's acceptable:

  • When switching to a different editor - the focus will be brought to the beginning of text of the page.

e.g A a user is typing in VE mode and decides to insert a template, switches to wikitext, then her cursor will be placed at the beginning of the text.

I'm moving this back to In Development, for two issues:

The cursor should always be at the end of the existing text, not the beginning. The purpose is to let the user continue typing, without another click.

In Firefox, the current patch for this ticket works going from VE to wikitext, but it doesn't work for wikitext to VE. In the wikitext --> VE direction, it's the old behavior, with no cursor in the field.

Change 232785 had a related patch set uploaded (by Catrope):
After switching editors, move cursor to end

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

Change 232785 had a related patch set uploaded (by Catrope):
After switching editors, move cursor to end

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

This puts the cursor at the end when switching. I haven't yet figured out why focusing VE doesn't work in Firefox; that might be a VE bug.

Change 232785 merged by jenkins-bot:
After switching editors, move cursor to end

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

The cursor should always be at the end of the existing text, not the beginning.

Done. Even if a cursor is in the middle of multi-paragraph text, switching to/from VE(or wikitext), will place the cursor at the beginning of the text.

In Firefox, the current patch for this ticket works going from VE to wikitext, but it doesn't work for wikitext to VE. In the wikitext --> VE direction, it's the old behavior, with no cursor in the field.

Works for new posts. When editing saved posts - it's the same old behavior in Chrome and FF:

  • switching from VE->wikitext: focus is lost.
  • switching from wikitext ->VE: the cursor is placed at the beginning of present text

Looks good -- I moved Elena's ticket about editing posts into the backlog queue.