Skip to content

Commit 580533e

Browse files
committed
Fix 'panel scrolling when selecting text' bug
1 parent 7febc10 commit 580533e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

css/panel.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ body {
3232
.mainTabs {
3333
height: 100%;
3434
margin-right: 0 !important;
35+
margin-bottom: 0;
3536
}
3637

3738
/* Turns dropdown into dropright for left-aligned nav-tabs */
@@ -50,14 +51,18 @@ body {
5051

5152
.mainTabsContent>.tab-pane {
5253
height: 100%;
53-
overflow-y: auto;
54+
overflow-y: auto;
5455
display: block !important; /* prevents render on tab change */
5556
position: absolute;
5657
width: 100%;
5758
}
5859
.mainTabsContent>.tab-pane>div { /* the actual tab content */
5960
/* By setting the padding here, the increasing of .tab-pane size is avoided */
60-
padding: 5px 15px 0 15px;
61+
padding: 5px 15px 15px 15px;
62+
}
63+
64+
.appComponentList {
65+
margin: 0;
6166
}
6267

6368
.appComponentList>li {

js/panel/views/main/DebuggerView.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ function(Backbone, _, $, Handlebars, template,
3737

3838
// Fix scroll alignment bug on devtools resizing:
3939
// by absolute positioning the tab contents, the contents size change
40-
// doesn't affect the position of those below them.
40+
// doesn't affect the position of the siblings.
4141
// NOTE: the distance between the contents should be greater than the maximum
42-
// devtools height (i.e. the screen height) or the contents may overlap
43-
componentsViewElWrapper.css("top", tabIndex*1000+"em");
42+
// devtools width (i.e. the screen width) or the contents may overlap
43+
componentsViewElWrapper.css("left", tabIndex*1000+"em");
4444
tabIndex++;
4545
}
4646
}
@@ -57,8 +57,8 @@ function(Backbone, _, $, Handlebars, template,
5757

5858
// display tab content
5959
var tabsContentContainer = this.$('.mainTabsContent');
60-
tabsContentContainer.scrollTop(tabsContentContainer.scrollTop() +
61-
tabContentElement.position().top);
60+
tabsContentContainer.scrollLeft(tabsContentContainer.scrollLeft() +
61+
tabContentElement.position().left);
6262
},
6363

6464
events: {

0 commit comments

Comments
 (0)