mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
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:
committed by
Pranav Senthilnathan
parent
e35d181fbb
commit
4c1ead0ed6
5
types/rc-slider/index.d.ts
vendored
5
types/rc-slider/index.d.ts
vendored
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user