percentage formatting, input box <=> form state mismatch
naseemkullah opened this issue · comments
Naseem commented
similar to #825
with something like
format={(value: string) => {
const stripped = value.replace(/\D/g, '');
return stripped ? `${stripped}%` : '';
}}
and an isAllowed rule allowing just 1 to 100 values, typing e.g. "555" results in 55% displayed visually, but 555
in the form state value.
Using with react-hook-form
FWIW.