File tree 3 files changed +8
-0
lines changed
examples/react-chayns-personfinder
src/react-chayns-personfinder
3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ export default class PersonFinderExample extends PureComponent {
124
124
parent = { document . getElementById ( 'portal-example' ) }
125
125
boxClassName = "custom-personfinder-overlay"
126
126
/>
127
+ < PersonFinder onInput = { console . log } />
127
128
< Button
128
129
onClick = { this . clear }
129
130
>
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ Then it can be used like in the following example:
42
42
| uacId | ID of the UAC-Group to search in | number | |
43
43
| locationId | LocationId of the UAC-Group to search in | number | |
44
44
| reducerFunction | Function to reduce the results (see example) | Function | |
45
+ | onInput | Callback on input | Function | |
45
46
46
47
## Clear the PersonFinder
47
48
If you want to clear the PersonFinder, you need to have a reference to the ReactElement:
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export default class SimplePersonFinder extends Component {
26
26
} ) ,
27
27
PropTypes . string ,
28
28
] ) ,
29
+ onInput : PropTypes . func ,
29
30
} ;
30
31
31
32
static defaultProps = {
@@ -35,6 +36,7 @@ export default class SimplePersonFinder extends Component {
35
36
defaultValue : null ,
36
37
className : null ,
37
38
showId : false ,
39
+ onInput : null ,
38
40
} ;
39
41
40
42
static PERSON = PERSON_RELATION ;
@@ -55,10 +57,14 @@ export default class SimplePersonFinder extends Component {
55
57
}
56
58
57
59
handleOnChange ( inputValue ) {
60
+ const { onInput } = this . props ;
58
61
this . setState ( {
59
62
inputValue,
60
63
selectedValue : false ,
61
64
} ) ;
65
+ if ( onInput && typeof onInput === 'function' ) {
66
+ onInput ( inputValue ) ;
67
+ }
62
68
}
63
69
64
70
handleSelect ( type , value ) {
You can’t perform that action at this time.
0 commit comments