| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
|
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
|
| index ae5450bd058ba0d9cbc3745eba90c460c48218b6..96f26359575e5de61c10c744038f74faea562e2a 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
|
| @@ -415,7 +415,20 @@ DesktopAutomationHandler.prototype = {
|
| cursors.Range.fromNode(evt.target));
|
| }
|
|
|
| - this.createTextEditHandlerIfNeeded_(evt.target);
|
| + // Re-target the node to the root of the editable.
|
| + var target = evt.target;
|
| + while (target.parent && target.parent.state.editable)
|
| + target = target.parent;
|
| + var voxTarget = ChromeVoxState.instance.currentRange.start.node;
|
| + while (voxTarget && voxTarget.parent && voxTarget.parent.state.editable)
|
| + voxTarget = voxTarget.parent;
|
| +
|
| + // It is possible that ChromeVox has range over some other node
|
| + // when a text field is focused.
|
| + if (!target.state.focused || target != voxTarget)
|
| + return;
|
| +
|
| + this.createTextEditHandlerIfNeeded_(target);
|
|
|
| // Sync the ChromeVox range to the editable, if a selection exists.
|
| var anchorObject = evt.target.root.anchorObject;
|
|
|