mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Respect horizontal scrollbar when rendering the vertical, and vice versa
We set overflow to hidden in the opposite scroll direction only if we can't actually scroll in that direction, causing the white square where neither scrollbar overlaps to appear at the lower right corner.
This commit is contained in:
@@ -547,6 +547,26 @@ describe "EditorComponent", ->
|
||||
bottomOfEditor = node.getBoundingClientRect().bottom
|
||||
expect(bottomOfLastLine).toBe bottomOfEditor
|
||||
|
||||
it "assigns the overflow to 'hidden' in the opposite direction unless the editor scrollable in that direction", ->
|
||||
expect(verticalScrollbarNode.style.overflowX).toBe 'hidden'
|
||||
expect(horizontalScrollbarNode.style.overflowY).toBe 'hidden'
|
||||
return
|
||||
|
||||
node.style.height = 4.5 * lineHeightInPixels + 'px'
|
||||
component.measureHeightAndWidth()
|
||||
expect(verticalScrollbarNode.style.overflowX).toBe 'hidden'
|
||||
expect(horizontalScrollbarNode.style.overflowY).toBe ''
|
||||
|
||||
node.style.width = 10 * charWidth + 'px'
|
||||
component.measureHeightAndWidth()
|
||||
expect(verticalScrollbarNode.style.overflowX).toBe ''
|
||||
expect(horizontalScrollbarNode.style.overflowY).toBe ''
|
||||
|
||||
node.style.height = 20 * lineHeightInPixels + 'px'
|
||||
component.measureHeightAndWidth()
|
||||
expect(verticalScrollbarNode.style.overflowX).toBe ''
|
||||
expect(horizontalScrollbarNode.style.overflowY).toBe 'hidden'
|
||||
|
||||
describe "when a mousewheel event occurs on the editor", ->
|
||||
it "updates the horizontal or vertical scrollbar depending on which delta is greater (x or y)", ->
|
||||
node.style.height = 4.5 * lineHeightInPixels + 'px'
|
||||
|
||||
Reference in New Issue
Block a user