react-querybuilder/react-querybuilder

Ability to enable/disable parseNumber per rule

oleg-andreyev opened this issue · 1 comments

Description of the feature

I think it would be great to have this ability - disable/enable parseNumber per rule

Use case

In general I have parseNumber enable, but there is a case: GTIN and EAN where I'd like to keep them as string due to leading zero in GTIN and this leading-zero is important.

You can do this today with a custom value editor:

const CustomValueEditor = (props: ValueEditorProps) => {
  if (/* your condition for turning off parseNumbers */) {
    return <ValueEditor {...props} parseNumbers={false} />
  }
  return <ValueEditor {...props} parseNumbers />
}