Vonage / vivid-3

Vonage's web UI 🎨 toolbelt
https://vivid.deno.dev
Apache License 2.0
54 stars 11 forks source link

[form association / text field] Success is authored but error should be programmatically triggered? #833

Closed yinonov closed 1 year ago

yinonov commented 1 year ago
    > > should this have its own ui test?

not sure we need... @YonatanKra WDTS?

@YonatanKra this raises the question of how success can be authored while error should be triggered

Originally posted by @yinonov in https://github.com/Vonage/vivid-3/issues/819#issuecomment-1314946783

YonatanKra commented 1 year ago

Ok - this is a good discussion. At the moment I think success takes precedence. There's a better case for making error take precedence. Are we for an error takes all?

yinonov commented 1 year ago

they should both be constrained to the other. the logic is

const errorIndicator = isError && not(isSuccess);

const successIndicator = isSuccess && not(isError);

is there a workaround to achieve user-valid state on reportValidity (post user interaction with control)

YonatanKra commented 1 year ago

Currently, the moment a user "unfocus" or "blurs" out of the element, the validation is running. user-valid will be true if there's no error or the element is still pristine.