react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

TextField label issues with enableErrors

Open ethanshar opened this issue 1 year ago • 5 comments

Description

Avoid hiding TextField label when field is invalid but enableErrors is false

Changelog

Fix issue with TextField's Label become hidden while field is invalid and enableErrors is false

Additional info

ethanshar avatar Jan 01 '24 14:01 ethanshar

That works. When the field is not valid the label still becomes red. Is that what we want? I feel like it should not show any indication about the errors. Using this: <TextField label="Required" validate={'required'} showMandatoryIndication validationMessage={'required'} enableErrors={false} validateOnChange validationMessagePosition={TextField.validationMessagePositions.TOP}/> Simulator Screen Recording - iPhone 14 Pro Max - 2024-01-02 at 10 01 22

nitzanyiz avatar Jan 02 '24 08:01 nitzanyiz

Let's also confirm this behavior with Diana tomorrow

ethanshar avatar Jan 03 '24 15:01 ethanshar

@NitzanWix take a look again, I made some fixes

ethanshar avatar Jan 10 '24 11:01 ethanshar

Now the label disappears on error. I think its this line https://github.com/wix/react-native-ui-lib/blob/b193b801ef97c763c594ccc1f080b35962a25b4b/src/components/textField/Label.tsx#L26C3-L26C108

Simulator Screen Recording - iPhone 14 Pro Max - 2024-01-14 at 15 09 05

nitzanyiz avatar Jan 14 '24 13:01 nitzanyiz

Snippet to reproduce

<TextField
  validate={'required'}
  label="Required"
  showMandatoryIndication
  validateOnChange
  validationMessagePosition="top"
  validationMessage={'this is required'}
  enableErrors={false}
/>

nitzanyiz avatar Mar 04 '24 10:03 nitzanyiz