mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
Allow arrow key navigation out of expanded subsections
This commit is contained in:
+1
-1
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user