Invalid state for number field

Hello, sorry for disturbing. Currently there is no way I could achieve error(invalid) state without providing actual message (string), however shopify/polaris was providing us with such opportunity.
Imagine I have something like this:

<s-number-field

        value={String(value)}

        min={min}

        max={max}

        suffix={suffix}

        prefix={prefix}

        label={label}

        labelAccessibilityVisibility={labelAccessibilityVisibility}

        details={details}

        disabled={disabled}

        error={error ? "" : undefined}

        id={id}

        placeholder={placeholder}

        readOnly={readOnly}

        onInput={handleInput}

        onBlur={handleBlur}

/>

passing an empty string or true (boolean) I am expecting number field to be in error(invalid) state without having message beneath. Right now it looks like there is no way to get in that state without providing an actual string which is annoying.

3 Likes

Same issue for me… :frowning:

It’s required to provide text because that’s a foundational requirement for accessibility. See Understanding Success Criterion 3.3.1: Error Identification | WAI | W3C

This is kind of lame as it was working differently in shopify/polaris
I don’t understand why u are changing the rules. It looks like completely different library now.

I don’t want to have messages under inputs and it means than I will not have error state…legendary.
Okay than do that if I provide empty text …it doesn’t show it. Right now it shows exclamation mark without text.