Feliz icon indicating copy to clipboard operation
Feliz copied to clipboard

prop.pattern produces invalid html

Open Samuel-Dufour opened this issue 1 month ago • 4 comments

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.

Samuel-Dufour avatar May 20 '24 17:05 Samuel-Dufour