Commit 58fab5d0 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Allow braille cursor routing at the end of the displayed braille content

Test: press braille cursor routing key one characer beyond the last character of the displayed text. See action applied to the end of the content such as selection.
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I50a6e5f1f1d708595ad52d026bf279267c96a233
Reviewed-on: https://chromium-review.googlesource.com/599108
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491610}
parent e76c304a
......@@ -634,7 +634,14 @@ Background.prototype = {
brailleRoutingCommand_: function(text, position) {
var actionNodeSpan = null;
var selectionSpan = null;
text.getSpans(position).forEach(function(span) {
// For a routing key press one cell beyond the last displayed character, use
// the node span for the last character. This enables routing selection to
// the length of the text, which is valid.
var nodePosition = position;
if (position == text.length && position > 0)
nodePosition--;
text.getSpans(nodePosition).forEach(function(span) {
if (span instanceof Output.SelectionSpan) {
selectionSpan = span;
} else if (span instanceof Output.NodeSpan) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment