scalajs-spa-tutorial icon indicating copy to clipboard operation
scalajs-spa-tutorial copied to clipboard

Modal breaks on scalajs-react 1.4

Open izzyreal opened this issue 5 years ago • 2 comments

This tutorial is one of the few and better resources to pick up some scalajs. The modal, however, doesn't work when upgrading to scalajs-react 1.4.

Perhaps the whole project can be updated to latest versions of everything.

izzyreal avatar Sep 17 '19 07:09 izzyreal

In Bootstrap.scala you do

jQuery(scope.getDOMNode).modal(js.Dynamic.literal...

Upgrading to scalajs-react 1.4 is breaking because getDOMNode now returns a ComponentDom.Mounted rather than an Element. I've tried doing jQuery(scope.getDOMNode.asElement()), but when opening the modal the console reads

Bootstrap.scala:101 Uncaught TypeError: jsx$2 is not a function
    at Bootstrap.scala:101
    at $c_sjsr_AnonFunction0.apply__O (AnonFunctions.scala:22)

izzyreal avatar Sep 17 '19 08:09 izzyreal

If you can fix it with a PR, that would be great! :)

ochrons avatar Sep 17 '19 08:09 ochrons