Page MenuHomePhabricator

CodeEditor $.textSelection('replaceSelection',...) fails
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Edit a page where CodeEditor is loaded, like a JS page
  • Run the following in the web console: $('#wpTextbox1').textSelection('replaceSelection', 'foo')

What happens?:
The editor is left unchanged and an error is logged in the console.

What should have happened instead?:
The current selection should have been replaced by the given content.

Event Timeline

Change 939309 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/extensions/CodeEditor@master] Add explicit replaceSelection() implementation

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

Change 939309 merged by jenkins-bot:

[mediawiki/extensions/CodeEditor@master] Add explicit replaceSelection() implementation

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

Change 940351 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/extensions/CodeEditor@master] Follow-up Ie3ed681b: Unstub getCaretPosition() as well

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

Change 940351 merged by jenkins-bot:

[mediawiki/extensions/CodeEditor@master] Follow-up Ie3ed681b: Unstub getCaretPosition() as well

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

TheDJ assigned this task to TK-999.