Commit ba8692f0 authored by John Lee's avatar John Lee Committed by Commit Bot

Bookmarks WebUI: Allow multi-select by toggling selection using spacebar

Bug: 1142077
Change-Id: I7f77980b2fd1ad1f50f94adaa63fa537c3199037
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559159
Commit-Queue: John Lee <johntlee@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831142}
parent 44c9578e
...@@ -194,6 +194,12 @@ Polymer({ ...@@ -194,6 +194,12 @@ Polymer({
this.focus(); this.focus();
} else if (e.key === 'ArrowRight') { } else if (e.key === 'ArrowRight') {
this.$.menuButton.focus(); this.$.menuButton.focus();
} else if (e.key === ' ') {
this.dispatch(selectItem(this.itemId, this.getState(), {
clear: false,
range: false,
toggle: true,
}));
} }
}, },
......
...@@ -297,17 +297,6 @@ Polymer({ ...@@ -297,17 +297,6 @@ Polymer({
if (e.shiftKey && this.getState().selection.anchor === null) { if (e.shiftKey && this.getState().selection.anchor === null) {
this.dispatch(updateAnchor(this.displayedIds_[oldFocusedIndex])); this.dispatch(updateAnchor(this.displayedIds_[oldFocusedIndex]));
} }
// If the focus moved from something other than a Ctrl + move event,
// update the selection.
const config = {
clear: !cursorModifier,
range: e.shiftKey,
toggle: false,
};
this.dispatch(selectItem(
this.displayedIds_[focusedIndex], this.getState(), config));
} }
} }
......
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