-
Notifications
You must be signed in to change notification settings - Fork 0
Settings/validate input #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| value: currentNewColor, | ||
| placeholder: `Default: ${defaultColor}`, | ||
| value: colorValue, | ||
| type: 'text', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just leave this here: https://devdocs.io/html/element/input/color
| const exampleProps = { | ||
| style: { | ||
| display: 'inline-block', | ||
| backgroundColor: colorToBeUsed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use CSS for all non dynamic values and inline style for only dynamic ones.
| } | ||
| componentWillUpdate(nextProps, nextState) { | ||
| const { stateValidation, newColorNames, } = this; | ||
| const isHexColor = colorKey => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from https://devdocs.io/html/element/input/color , you should use input[pattern] https://devdocs.io/html/attributes#pattern-attribute and use the validity property CSS https://devdocs.io/css/:valid and API https://devdocs.io/dom/validitystate
All of these are documented well here: https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Form_validation
* fix Nick's comments to PR#7 * fix a function name according to Nick's comments to PR#7 * fix Nick's comments to PR#7 and PR#8 * remove dist/ from git repository * add page header to settings page * add color inputs and submit button for settings page * fix missing key in NewColorsInput * change lint rule regarding the label tag and refactor code accordingly * update key value from index to colorLetter * fix indentation * refactor the setState syntax * change text shown * Settings/validate input (#11) * add validation on input entry * add validation for new color inputs * clean SettingPanel variables * add feedback and design and design the settings panel * change the color input type from text to color * add reset button * prepare for github pages deployement
the app now validates the new color inputs and uses default values if the input is NOT valid.