mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Fix issue where sidebar controls could be keyboard-navigated while the sidebar was hidden
This commit is contained in:
@@ -812,6 +812,9 @@ a.hide-toggle {
|
||||
left: -6px;
|
||||
}
|
||||
|
||||
.sidebar.collapsed > *:not(.sidebar-resizer) {
|
||||
display: none;
|
||||
}
|
||||
.sidebar.collapsed .sidebar-resizer {
|
||||
/* make target wider to avoid the user accidentally resizing window */
|
||||
width: 10px;
|
||||
|
||||
@@ -379,7 +379,13 @@ export function uiSidebar(context) {
|
||||
endMargin = 0;
|
||||
}
|
||||
|
||||
selection.transition()
|
||||
if (!isCollapsing) {
|
||||
// unhide the sidebar's content before it transitions onscreen
|
||||
selection.classed('collapsed', isCollapsing);
|
||||
}
|
||||
|
||||
selection
|
||||
.transition()
|
||||
.style(xMarginProperty, endMargin + 'px')
|
||||
.tween('panner', function() {
|
||||
var i = d3_interpolateNumber(startMargin, endMargin);
|
||||
@@ -390,7 +396,10 @@ export function uiSidebar(context) {
|
||||
};
|
||||
})
|
||||
.on('end', function() {
|
||||
selection.classed('collapsed', isCollapsing);
|
||||
if (isCollapsing) {
|
||||
// hide the sidebar's content after it transitions offscreen
|
||||
selection.classed('collapsed', isCollapsing);
|
||||
}
|
||||
|
||||
// switch back from px to %
|
||||
if (!isCollapsing) {
|
||||
|
||||
Reference in New Issue
Block a user