Skip to content

Commit

Permalink
Fix bug in scroll content backgroundColor comparison with null
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Bok committed Dec 28, 2015
1 parent b71627c commit 59923c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion framer/Components/ScrollComponent.coffee
Expand Up @@ -162,7 +162,7 @@ class exports.ScrollComponent extends Layer
# color around until you set a content layer so you can see the ScrollComponent
# on your screen after creation.
if @content.subLayers.length
if @content.backgroundColor.isEqual(Framer.Defaults.Layer.backgroundColor)
if @content.backgroundColor?.isEqual(Framer.Defaults.Layer.backgroundColor)
@content.backgroundColor = null

@define "scroll",
Expand Down
8 changes: 8 additions & 0 deletions test/tests/ScrollComponentTest.coffee
Expand Up @@ -69,3 +69,11 @@ describe "ScrollComponent", ->
scroll = ScrollComponent.wrap(layerA)
scroll.width.should.equal Screen.width
scroll.height.should.equal Screen.height

it "should work with null backgroundColor", ->

layerA = new Layer
layerB = new Layer superLayer:layerA

delete layerA._properties.backgroundColor
scroll = ScrollComponent.wrap(layerA)

0 comments on commit 59923c4

Please sign in to comment.