[Ur] Javascript alerts

Saulo Araujo saulo2 at gmail.com
Thu Aug 4 08:59:41 EDT 2016


Maybe this information is also useful: if the pushPinButtonView function is
changed (like below) to always maintain the button in the DOM and show and
hide it by setting the display attribute value to none or initial
respectively, the bug also does not show up.

fun pushPinButtonView isVisibleSource isActiveSource onclick =
    let val dynClass =
   isActive <- signal isActiveSource;
   return (classes (CLASS "btn btn_sm pull_right")
   (if isActive then btn_primary else btn_default))

val dynStyle =
   isVisible <- signal isVisibleSource;
   return (if isVisible
   then STYLE "display: initial"
   else STYLE "display: none")
    in
return
   <xml>
     <button dynClass={dynClass} dynStyle={dynStyle} onclick={onclick}>
<i class="glyphicon glyphicon_pushpin"></i>
 
     </button>
   </xml>
    end

On Thu, Aug 4, 2016 at 9:22 AM, Saulo Araujo <saulo2 at gmail.com> wrote:

> Hi Adam,
>
> It took me some time, but after a lot of code removal (FFI, database and
> logic) I believe I have a small test case that shows the bug. You can get
> it with the command
>
> git clone -b bug https://github.com/saulo2/timesheet-ur.git
>
> To reproduce the bug, follow the steps below:
>
> 1) click the first button (a list of other buttons will be shown below the
> first button)
> 2) click the button associated to "Project 1"
> 3) click the first button again (the list of buttons will be hidden)
> 4) click the first button one last time (a JavaScript alert saying "Failed
> to execute append child on Node..." will be shown)
>
> Also, I found out that if you change line 76 from
>
> <button dynClass={dynClass} onclick={onclick}>
>
> to
>
> <button onclick={onclick}>
>
> the bug does not show up. Therefore, maybe the bug is related to the
> dynClass JavaScript function.
>
> If is there anything else that I can do to help, please let me know.
>
> Sincerely,
> Saulo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20160804/574c3da1/attachment.html>


More information about the Ur mailing list