Skip to content

Commit

Permalink
Fix classNames when no tagName is specified.
Browse files Browse the repository at this point in the history
  • Loading branch information
Madeorsk committed Oct 31, 2020
1 parent b6ec8f5 commit 19ac20f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/trix/views/piece_view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ class Trix.PieceView extends Trix.ObjectView
if config.style
styles[key] = value for key, value of config.style

if config.className
pendingElement.className = config.className

if Object.keys(styles).length
element ?= makeElement("span")
element.style[key] = value for key, value of styles

if config.className
element.className = config.className

element

createContainerElement: ->
Expand Down

0 comments on commit 19ac20f

Please sign in to comment.