Feliz
Feliz copied to clipboard
prop.pattern produces invalid html
The prop.pattern
function available on input to provide a validation pattern takes a regular expression parameter and generates a js regex instead of the pattern only.
For example
prop.pattern (System.Text.RegularExpressions.Regex "\d{2}:\d{2}:\d{2}")
produces pattern="/\d{2}:\d{2}:\d{2}/gu"
What should be produced is pattern="\d{2}:\d{2}:\d{2}"
.
A workaround is to use Interop.mkAttr "pattern" "\d{2}:\d{2}:\d{2}"
so it could replace the current implementation but it means the pattern validity is checked later.