Allow arrow key navigation out of expanded subsections

This commit is contained in:
Quincy Morgan
2019-03-04 13:56:34 -05:00
parent 734731bfda
commit 929a27b384
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -680,7 +680,7 @@ button.add-note svg.icon {
.search-add .list-item button.choose:focus {
background: #fff;
}
.search-add .list-item.focused:not(.disabled) button {
.search-add .list-item.focused:not(.disabled) button.choose {
background: #e8ebff;
}
.search-add .list-item button.choose.disabled {
+13
View File
@@ -69,6 +69,12 @@ export function uiSearchAdd(context) {
nextFocus = d3_select(priorFocus.nodes()[0].nextElementSibling)
.selectAll('.list-item:first-child');
}
if (nextFocus.empty()) {
var parentSubsection = priorFocus.nodes()[0].closest('.list .subsection');
if (parentSubsection && parentSubsection.nextElementSibling) {
nextFocus = d3_select(parentSubsection.nextElementSibling);
}
}
}
if (!nextFocus.empty()) {
focusListItem(nextFocus);
@@ -81,10 +87,17 @@ export function uiSearchAdd(context) {
priorFocus = popover.selectAll('.list .list-item.focused');
if (!priorFocus.empty()) {
nextFocus = d3_select(priorFocus.nodes()[0].previousElementSibling);
if (!nextFocus.empty() && !nextFocus.classed('list-item')) {
nextFocus = nextFocus.selectAll('.list-item:last-child');
}
if (nextFocus.empty()) {
var parentSubsection = priorFocus.nodes()[0].closest('.list .subsection');
if (parentSubsection && parentSubsection.previousElementSibling) {
nextFocus = d3_select(parentSubsection.previousElementSibling);
}
}
if (!nextFocus.empty()) {
focusListItem(nextFocus);
priorFocus.classed('focused', false);