Skip to content

Commit

Permalink
Add checks for formAction attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
evancz committed Apr 1, 2018
1 parent 09f7957 commit 9f9e03e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Elm/Kernel/VirtualDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,14 @@ function _VirtualDom_noScript(tag)
return tag == 'script' ? 'p' : tag;
}

function _VirtualDom_noOn(key)
function _VirtualDom_noOnOrFormAction(key)
{
return /^on/i.test(key) ? 'data-' + key : key;
return /^(on|formAction$)/i.test(key) ? 'data-' + key : key;
}

function _VirtualDom_noInnerHtml(key)
function _VirtualDom_noInnerHtmlOrFormAction(key)
{
return key == 'innerHTML' ? 'data-' + key : key;
return key == 'innerHTML' || key == 'formAction' ? 'data-' + key : key;
}

function _VirtualDom_noJavaScriptUri__PROD(value)
Expand Down
6 changes: 3 additions & 3 deletions src/VirtualDom.elm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ would be in JavaScript, not `for` as it would appear in HTML.
property : String -> Json.Value -> Attribute msg
property key value =
Elm.Kernel.VirtualDom.property
(Elm.Kernel.VirtualDom.noInnerHtml key)
(Elm.Kernel.VirtualDom.noInnerHtmlOrFormAction key)
(Elm.Kernel.VirtualDom.noJavaScriptOrHtmlUri value)


Expand All @@ -181,7 +181,7 @@ be in HTML, not `htmlFor` as it would appear in JS.
attribute : String -> String -> Attribute msg
attribute key value =
Elm.Kernel.VirtualDom.attribute
(Elm.Kernel.VirtualDom.noOn key)
(Elm.Kernel.VirtualDom.noOnOrFormAction key)
(Elm.Kernel.VirtualDom.noJavaScriptOrHtmlUri value)


Expand All @@ -199,7 +199,7 @@ attributeNS : String -> String -> String -> Attribute msg
attributeNS namespace key value =
Elm.Kernel.VirtualDom.attributeNS
namespace
(Elm.Kernel.VirtualDom.noOn key)
(Elm.Kernel.VirtualDom.noOnOrFormAction key)
(Elm.Kernel.VirtualDom.noJavaScriptOrHtmlUri value)


Expand Down

0 comments on commit 9f9e03e

Please sign in to comment.