This repository was archived by the owner on Dec 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 4545 "babel-preset-react" : " ^6.11.1" ,
4646 "babel-preset-stage-0" : " ^6.5.0" ,
4747 "gh-pages" : " ^1.0.0" ,
48- "material-ui" : " ^0.19.1 " ,
48+ "material-ui" : " ^0.20.0 " ,
4949 "react" : " ^16.0.0" ,
5050 "react-dom" : " ^16.0.0" ,
5151 "standard" : " ^10.0.2"
5252 },
5353 "peerDependencies" : {
54- "material-ui" : " >= 0.19.0 < 1.0.0" ,
54+ "material-ui" : " >= 0.19.1 < 1.0.0" ,
5555 "react" : " ^15.3.2 || ^16.0.0" ,
5656 "react-dom" : " ^15.3.2 || ^16.0.0"
5757 },
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ class ChipInput extends React.Component {
158158 }
159159 }
160160
161- this . autoComplete . handleItemTouchTap = ( event , child ) => {
161+ const onAutocompleteItemClick = ( event , child ) => {
162162 const dataSource = this . autoComplete . props . dataSource
163163
164164 const index = parseInt ( child . key , 10 )
@@ -170,6 +170,13 @@ class ChipInput extends React.Component {
170170 setTimeout ( ( ) => this . focus ( ) , 1 )
171171 }
172172
173+ // Ensuring that ChipInput works with with Material-UI 0.19.1 and 0.20.0
174+ if ( this . autoComplete . handleItemClick ) {
175+ this . autoComplete . handleItemClick = onAutocompleteItemClick ;
176+ } else {
177+ this . autoComplete . handleItemTouchTap = onAutocompleteItemClick
178+ }
179+
173180 // force update autocomplete to ensure that it uses the new handlers
174181 this . autoComplete . forceUpdate ( )
175182 }
You can’t perform that action at this time.
0 commit comments