debugger
debugger copied to clipboard
The dropdown button does not display by resizing center pane
Steps to Reproduce:
- Start Nightly
- Go to any sites (e.g. about:home)
- Open DevTools > Debugger (Ctrl+Shift+S)
- Open more than two sources, but source tab is not overflowed
- Narrow center pane until source tab is overflowed
Actual Results: The dropdown button does not display by resizing center pane.
Expected Results:
- The dropdown button is displayed if source tab is overflowed by resizing center pane.
- The dropdown button is hidden if source tab is not overflowed by resizing center pane.
Here's a patch that should be close to what we need to do.
diff --git a/src/components/SourceTabs.js b/src/components/SourceTabs.js
index 20a7e8e..82721ac 100644
--- a/src/components/SourceTabs.js
+++ b/src/components/SourceTabs.js
@@ -61,7 +61,16 @@ const SourceTabs = React.createClass({
},
componentDidUpdate() {
- this.updateHiddenSourceTabs(this.props.sourceTabs);
+ this.updateHiddenSourceTabs();
+ },
+
+ componentDidMount() {
+ this.updateHiddenSourceTabs();
+ window.addEventListener("resize", this.updateHiddenSourceTabs, false);
+ },
+
+ componentDidDismount() {
+ window.removeEventListener("resize", this.updateHiddenSourceTabs);
},
onTabContextMenu(event, tab) {
@@ -127,7 +136,8 @@ const SourceTabs = React.createClass({
* Updates the hiddenSourceTabs state, by
* finding the source tabs who have wrapped and are not on the top row.
*/
- updateHiddenSourceTabs(sourceTabs) {
+ updateHiddenSourceTabs() {
+ const sourceTabs = this.props.sourceTabs;
if (!this.refs.sourceTabs) {
return;
}