Skip to content

Commit

Permalink
Test that the root node is an element
Browse files Browse the repository at this point in the history
  • Loading branch information
weotch committed Jan 19, 2024
1 parent 58977c0 commit 9bd9b53
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/concerns/dimensions.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export default
@onResize()

# Resize observer listens for the element itself to change dimensions
@resizeObserver = new ResizeObserver @onResize
@resizeObserver.observe @$el
if @$el?.nodeType == Node.ELEMENT_NODE
@resizeObserver = new ResizeObserver @onResize
@resizeObserver.observe @$el

beforeDestroy: ->
@resizeObserver?.disconnect()
Expand Down

0 comments on commit 9bd9b53

Please sign in to comment.