mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #24132 from bungu/patch-1
[react-input-mask] Add inputRef type definition
This commit is contained in:
Vendored
+5
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-input-mask 0.7
|
||||
// Type definitions for react-input-mask 1.2
|
||||
// Project: https://github.com/sanniassin/react-input-mask
|
||||
// Definitions by: Alexandre Paré <https://github.com/apare>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -36,6 +36,10 @@ declare namespace reactInputMask {
|
||||
* Show mask even in empty input without focus.
|
||||
*/
|
||||
alwaysShowMask?: boolean;
|
||||
/**
|
||||
* Use inputRef instead of ref if you need input node to manage focus, selection, etc.
|
||||
*/
|
||||
inputRef?: React.Ref<HTMLInputElement>;
|
||||
}
|
||||
class ReactInputMask extends React.Component<ReactInputMaskProps> {
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import ReactInputMask from 'react-input-mask';
|
||||
import * as React from 'react';
|
||||
|
||||
let ref: HTMLInputElement | null = null;
|
||||
|
||||
<div>
|
||||
<ReactInputMask mask="+4\9 99 999 99" maskChar={null} />
|
||||
<ReactInputMask mask="+7 (999) 999-99-99" />
|
||||
<ReactInputMask mask="99-99-9999" defaultValue= "13-00-2017" />
|
||||
<ReactInputMask mask="99/99/9999" placeholder= "Enter birthdate" />
|
||||
<ReactInputMask mask="+7 (999) 999-99-99" />
|
||||
<ReactInputMask mask="+7 (999) 999-99-99" inputRef={(node) => ref = node} />
|
||||
</div>;
|
||||
|
||||
Reference in New Issue
Block a user