Skip to content

Bug: Number range picker blocks typing when intermediate values fall outside min/max bounds #733

@BrianWhitneyAI

Description

@BrianWhitneyAI

Description

When filtering on a number annotation (e.g. acquisition_date read as a numeric value), it is impossible to type a new value into the min or max input fields.

Root Cause

In NumberField.tsx, the validateInput function used an early return when the current input value was outside the allowed min/max bounds:

return event.target.setCustomValidity("Value out of bounds");

Since the input is controlled (value={props.defaultValue}), blocking onChange means the parent state never updates, and React resets the field to the previous value on every keystroke. This makes typing impossible for fields like acquisition_date where every intermediate keystroke (e.g. 2, 20, 202, 2024...) is numerically less than the large overall minimum.

Fix

Remove the early return so props.onChange always fires, and add an else branch to clear the browser's custom validity when the value is back in bounds.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions