mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Merge pull request #11866 from atom/as-min-width-0
Fix flexbox issues after upgrading to Electron v0.37.8
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
PaneContainer = require '../src/pane-container'
|
||||
|
||||
describe "PaneElement", ->
|
||||
[paneElement, container, pane] = []
|
||||
[paneElement, container, containerElement, pane] = []
|
||||
|
||||
beforeEach ->
|
||||
spyOn(atom.applicationDelegate, "open")
|
||||
|
||||
container = new PaneContainer(config: atom.config, confirm: atom.confirm.bind(atom))
|
||||
containerElement = atom.views.getView(container)
|
||||
pane = container.getActivePane()
|
||||
paneElement = atom.views.getView(pane)
|
||||
|
||||
@@ -195,3 +196,18 @@ describe "PaneElement", ->
|
||||
event = buildDragEvent("drop", [])
|
||||
paneElement.dispatchEvent(event)
|
||||
expect(atom.applicationDelegate.open).not.toHaveBeenCalled()
|
||||
|
||||
describe "resize", ->
|
||||
it "shrinks independently of its contents' width", ->
|
||||
jasmine.attachToDOM(containerElement)
|
||||
item = document.createElement('div')
|
||||
item.style.width = "2000px"
|
||||
item.style.height = "30px"
|
||||
paneElement.insertBefore(item, paneElement.children[0])
|
||||
|
||||
paneElement.style.flexGrow = 0.1
|
||||
expect(paneElement.getBoundingClientRect().width).toBeGreaterThan(0)
|
||||
expect(paneElement.getBoundingClientRect().width).toBeLessThan(item.getBoundingClientRect().width)
|
||||
|
||||
paneElement.style.flexGrow = 0
|
||||
expect(paneElement.getBoundingClientRect().width).toBe(0)
|
||||
|
||||
@@ -64,10 +64,6 @@ class LinesComponent extends TiledComponent
|
||||
@domNode.appendChild(@placeholderTextDiv)
|
||||
@oldState.placeholderText = @newState.placeholderText
|
||||
|
||||
if @newState.width isnt @oldState.width
|
||||
@domNode.style.width = @newState.width + 'px'
|
||||
@oldState.width = @newState.width
|
||||
|
||||
@cursorsComponent.updateSync(state)
|
||||
|
||||
buildComponentForTile: (id) -> new LinesTileComponent({id, @presenter, @domElementPool, @assert, @grammars})
|
||||
|
||||
@@ -48,6 +48,7 @@ atom-pane-container {
|
||||
-webkit-flex: 1;
|
||||
-webkit-flex-direction: column;
|
||||
overflow: visible;
|
||||
min-width: 0;
|
||||
|
||||
.item-views {
|
||||
-webkit-flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user