Skip to content

Letter case support

Choose a tag to compare

@TrySound TrySound released this 21 Feb 11:42
· 71 commits to master since this release

It's often useful to enforce lower or upper case in inputs but it's not enough to run string.toLowerCase() in value/onChange data flow. In this release we added support for casing.

<Rifm format={v => v.toLowerCase()} refuse={/$^/} value={value} onChange={setValue}>
  {({ value, onChange }) => (
    <input value={value} onChange={onChange} />
  )}
</Rifm>

There is also a small DX improvement. Rifm shows error when you are trying to bind input with type="number" which manipulates only numbers when rifm manipulates strings.