Skip to content

Commit

Permalink
Refactor #538
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Sep 20, 2018
1 parent 98c58cb commit 447cdca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/components/spinner/Spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export class Spinner extends Component {
inputClassName: null,
tooltip: null,
tooltipOptions: null,
onChange: null
onChange: null,
onBlur: null
}

static propsTypes = {
Expand All @@ -47,7 +48,8 @@ export class Spinner extends Component {
inputClassName: PropTypes.string,
tooltip: PropTypes.string,
tooltipOptions: PropTypes.object,
onChange: PropTypes.func
onChange: PropTypes.func,
onBlur: PropTypes.func
}

constructor(props) {
Expand Down Expand Up @@ -277,15 +279,7 @@ export class Spinner extends Component {
}

if (this.props.onBlur) {
this.props.onBlur({
event: event,
stopPropagation : () =>{},
preventDefault : () =>{},
target: {
name: this.props.name,
id: this.props.id,
}
});
this.props.onBlur(event);
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/showcase/spinner/SpinnerDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ import {Spinner} from 'primereact/spinner';
<td>event.value: New value</td>
<td>Callback to invoke on value change.</td>
</tr>
<tr>
<td>onBlur</td>
<td>event: Browser event</td>
<td>Callback to invoke when Spinner loses focus.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 447cdca

Please sign in to comment.