Skip to content

Commit

Permalink
[Tab Group Collapse] Keyboard does not move tabs into a collapsed group.
Browse files Browse the repository at this point in the history
Using F6 to cycle to a tab, then using CTRL+LEFT/RIGHT will not move a
tab into a collapsed group.

Bug: 1018230
Change-Id: I497075710186a8ab0d67971aa9fc203147057dc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219402
Reviewed-by: Connie Wan <connily@chromium.org>
Commit-Queue: Charlene Yan <cyan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773941}
  • Loading branch information
Charlene Yan authored and Commit Bot committed Jun 2, 2020
1 parent 3ea2a18 commit f9bfb7c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions chrome/browser/ui/views/tabs/tab_strip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2892,17 +2892,19 @@ void TabStrip::ShiftTabRelative(Tab* tab, int offset) {
return;
}

// If the tab is at a group boundary, instead of actually moving the tab just
// change its group membership.
// If the tab is at a group boundary and the group is expanded, instead of
// actually moving the tab just change its group membership.
base::Optional<tab_groups::TabGroupId> target_group =
tab_at(target_index)->group();
if (tab->group() != target_group) {
if (tab->group().has_value())
if (tab->group().has_value()) {
controller_->RemoveTabFromGroup(start_index);
else if (target_group.has_value())
return;
} else if (target_group.has_value() &&
!controller_->IsGroupCollapsed(target_group.value())) {
controller_->AddTabToGroup(start_index, target_group.value());

return;
return;
}
}

controller_->MoveTab(start_index, target_index);
Expand Down

0 comments on commit f9bfb7c

Please sign in to comment.