Skip to content

Commit

Permalink
Fix setValue, render in ListEditor
Browse files Browse the repository at this point in the history
Closes #3
  • Loading branch information
wesvetter committed Oct 3, 2018
1 parent cdd0b5a commit 3c43b1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/editors/extra/list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@
else
if !@Editor.isAsync
@addItem()
#Save a copy of the pre-exising element, if exists
domReferencedElement = @el
@setElement $el
#In case of there was a pre-existing element already placed in the DOM, then update it
if domReferencedElement
$(domReferencedElement).replaceWith @el
@$el.attr 'id', @id
@$el.attr 'name', @key
if @hasFocus
Expand Down Expand Up @@ -148,6 +153,7 @@
#Filter empty items
_.without values, undefined, ''
setValue: (value) ->
@items = []
@value = value
@render()
return
Expand Down

0 comments on commit 3c43b1d

Please sign in to comment.