diff --git a/source/list.coffee b/source/list.coffee index 1a9b4fe..b2b5b6f 100644 --- a/source/list.coffee +++ b/source/list.coffee @@ -9,7 +9,7 @@ class List extends Widget constructor: (selector, itemSelector, driver, widget) -> super selector, driver @Widget = widget ? Widget - @itemSelector ?= itemSelector + @itemSelector = itemSelector if itemSelector? @_nestedItemsSelector = "#{@selector} #{@itemSelector}" @widgets = @_wrapAsWidgets(@driver.elements(@_nestedItemsSelector).value) diff --git a/source/widget.coffee b/source/widget.coffee index f796bf8..d407152 100644 --- a/source/widget.coffee +++ b/source/widget.coffee @@ -21,7 +21,7 @@ class Widget extends Base selector: null constructor: (selector, @driver=driver.api) -> - @selector ?= selector + @selector = selector if selector? if not typeof @selector is 'string' throw new Error "Invalid selector given: #{@selector}"