File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " formsy-react-components" ,
3- "version" : " 2.0.0-alpha.2 " ,
3+ "version" : " 2.0.0-alpha.3 " ,
44 "description" : " Bootstrap components for a formsy-react form." ,
55 "scripts" : {
66 "test" : " jest" ,
3737 "url" : " https://github.com/twisty/formsy-react-components/issues"
3838 },
3939 "peerDependencies" : {
40- "formsy-react" : " ^2.0.0-beta.2 " ,
40+ "formsy-react" : " formsy/formsy-react#cbce6b1 " ,
4141 "react" : " ^16.3.0"
4242 },
4343 "dependencies" : {
6262 "eslint-plugin-jsx-a11y" : " ^6.2.1" ,
6363 "eslint-plugin-prettier" : " ^3.0.0" ,
6464 "eslint-plugin-react" : " ^7.14.2" ,
65- "formsy-react" : " ^2.0.0-beta.2 " ,
65+ "formsy-react" : " formsy/formsy-react#cbce6b1 " ,
6666 "gh-pages" : " ^2.0.0" ,
6767 "jest" : " ^24.1.0" ,
6868 "prettier" : " ^1.6.1" ,
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
2+ import classNames from 'classnames/dedupe' ;
23import { componentDefaultProps } from './component-common' ;
34import ErrorMessages from './error-messages' ;
45import Help from './help' ;
@@ -47,21 +48,26 @@ class Select extends React.Component<SelectProps, {}> {
4748
4849 public render ( ) : JSX . Element {
4950 const {
51+ className,
5052 errorMessages,
5153 help,
5254 id,
5355 layout,
5456 name,
57+ required,
5558 showErrors,
5659 ...inputProps
5760 } = this . props ;
5861 Object . keys ( componentDefaultProps ) . forEach ( ( key ) : void => {
5962 delete inputProps [ key ] ;
6063 } ) ;
6164
65+ const markAsInvalid = showErrors && ( errorMessages . length > 0 || required ) ;
66+
6267 const control = (
6368 < SelectControl
6469 { ...inputProps }
70+ className = { classNames ( markAsInvalid ? [ 'is-invalid' , className ] : className ) }
6571 elementRef = { this . props . elementRef }
6672 id = { id }
6773 name = { name }
Original file line number Diff line number Diff line change @@ -2828,10 +2828,9 @@ form-data@~2.3.2:
28282828 combined-stream "^1.0.6"
28292829 mime-types "^2.1.12"
28302830
2831- formsy-react@^2.0.0-beta.2 :
2831+ formsy-react@formsy/formsy-react#cbce6b1 :
28322832 version "2.0.0-beta.4"
2833- resolved "https://registry.yarnpkg.com/formsy-react/-/formsy-react-2.0.0-beta.4.tgz#14c95f26c2d607f1d1a447362680e73a692d20b3"
2834- integrity sha512-6o42LbZ6IO8UQIBGQaOoo0yjYfr1rDSv2fKNgRXZHQTGWoZU8vnBe7RttCCIxYp5AeTO67A86SGiAmsKsqh+/A==
2833+ resolved "https://codeload.github.com/formsy/formsy-react/tar.gz/cbce6b1f7ff8b3721ccf22d05f3aba0b7c9185f4"
28352834 dependencies :
28362835 form-data-to-object "^0.2.0"
28372836 prop-types "^15.7.2"
You can’t perform that action at this time.
0 commit comments