Adds onBlur typings to rc-slider (#37644)

* Add onBlur typings to rc-slider

* Adds onBlur to rc-slider, adds this prop to tests

* Add semicolon to rc-slider tests
This commit is contained in:
Yankovsky Andrey
2019-08-15 21:45:37 +03:00
committed by Pranav Senthilnathan
parent e35d181fbb
commit 4c1ead0ed6
2 changed files with 8 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
// Nick Maddren <https://github.com/nicholasmaddren>
// Roman Nevolin <https://github.com/nulladdict>
// Mojtaba Izadmehr <https://github.com/m-izadmehr>
// Andrey Yankovsky <https://github.com/yankovsky>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -135,6 +136,10 @@ export interface SliderProps extends CommonApiProps {
* onAfterChange will be triggered when ontouchend or onmouseup is triggered.
*/
onAfterChange?(value: number): void;
/**
* Handle blur event on the control
*/
onBlur?: React.FocusEventHandler;
/**
* Set initial value of slider.
* @default 0

View File

@@ -24,6 +24,8 @@ const onChangeFunc1 = (string: number) => {};
const onChangeFunc2 = (string: number[]) => {};
const onBlurFunc = (e: React.FocusEvent) => {};
ReactDOM.render(
<Slider
className="bottomRight"
@@ -38,6 +40,7 @@ ReactDOM.render(
dots={true}
onBeforeChange={onChangeFunc1}
onChange={onChangeFunc1}
onBlur={onBlurFunc}
onAfterChange={onChangeFunc1}
defaultValue={0.1}
value={0.1}