Corrects CSS for focused preset list item button

Fixes arrow key navigation for right-to-left layouts
This commit is contained in:
Quincy Morgan
2018-10-11 19:04:01 -07:00
parent b199b85829
commit 51b2335b96
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -1129,7 +1129,8 @@ a.hide-toggle {
border-radius: 3px 0 0 3px;
}
.preset-list-button:hover .label {
.preset-list-button:hover .label,
.preset-list-button:focus .label {
background-color: #ececec;
}
+4 -4
View File
@@ -235,7 +235,7 @@ export function uiPresetList(context) {
}
}
// arrow left, move focus to the parent item if there is one
else if (d3_event.keyCode === d3_keybinding.keyCodes['←']) {
else if (d3_event.keyCode === d3_keybinding.keyCodes[(textDirection === 'rtl') ? '→' : '←']) {
d3_event.preventDefault();
d3_event.stopPropagation();
@@ -246,7 +246,7 @@ export function uiPresetList(context) {
}
}
// arrow right, choose this item
else if (d3_event.keyCode === d3_keybinding.keyCodes['→']) {
else if (d3_event.keyCode === d3_keybinding.keyCodes[(textDirection === 'rtl') ? '←' : '→']) {
d3_event.preventDefault();
d3_event.stopPropagation();
item.datum().choose();
@@ -282,7 +282,7 @@ export function uiPresetList(context) {
.on('click', click)
.on('keydown', function() {
// right arrow, expand the focused item
if (d3_event.keyCode === d3_keybinding.keyCodes['→']) {
if (d3_event.keyCode === d3_keybinding.keyCodes[(textDirection === 'rtl') ? '←' : '→']) {
d3_event.preventDefault();
d3_event.stopPropagation();
// if the item isn't expanded
@@ -291,7 +291,7 @@ export function uiPresetList(context) {
click.call(this);
}
// left arrow, collapse the focused item
} else if (d3_event.keyCode === d3_keybinding.keyCodes['←']) {
} else if (d3_event.keyCode === d3_keybinding.keyCodes[(textDirection === 'rtl') ? '→' : '←']) {
d3_event.preventDefault();
d3_event.stopPropagation();
// if the item is expanded