luckylwk / hoppin-design-system

Hoppin Design System (HDS)
https://design.gohoppin.com
1 stars 0 forks source link

Required field for Async-select #14

Closed luckylwk closed 4 years ago

luckylwk commented 4 years ago

Currently not working. It is required, but doesn't pick up on a value being there

image

image
luckylwk commented 4 years ago

Can you have a look at this @jonashaefele . Adding a required field for async-select does not work currently

luckylwk commented 4 years ago

So what I am experiencing is the following: Whenever the scheduler opens there are two starting scenarios: either there is already a meeting_address value or the value is an empty string.

Option 1: Value preset

When the value is set the form (and the field is flagged as required) the form does not want to proceed:

image

When I then change the value (using the google search) is still does not allow to continue:

image

Option 2: No value (empty string)

Same behavior when changing the value

image

Do we have to add a manual validation function inside the field specification, or can we update the HDS to validate (what is a 'neater' solution at this stage?). image

jonashaefele commented 4 years ago

I think what happens is that the frontend changes, but the data (state) doesn't. Hence the onChange handlers not getting called and the required check not updating.

Shouldn't need a validate function. That is on top of the required check, not instead of.

Probably soemthing to do with all the filters like these:

https://github.com/luckylwk/hoppin-design-system/blob/v0.4.11/src/components/Form/Fields.js#L88

https://github.com/luckylwk/hoppin-design-system/blob/v0.4.11/src/components/Form/Fields.js#L142