Skip to content

Commit

Permalink
docs(input): update useWhitespacesInMask description (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailVetyugov authored Apr 23, 2020
1 parent 1e2fa79 commit 65f65d5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,3 +660,23 @@ const selectOptions = [
</div>
</div>
```

Использование свойств `maskFormatCharacters` и `useWhitespacesInMask`
```jsx
const customFormatter = {
s: {
validate(char) {
return /[Ёёа-яА-Яa-zA-Z0-9\s]/.test(char);
}
}
};

<div>
<Input
placeholder='Введите ваше имя'
mask='sssssssssssssss'
maskFormatCharacters={ customFormatter }
useWhitespacesInMask={ true }
/>
</div>
```
3 changes: 2 additions & 1 deletion src/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ export type InputProps = DeepReadonly<{
mask?: string;

/**
* Позволяет использовать пробелы в маске
* Разрешает ставить пробелы в инпуте, если они указаны в форматтере, заданном свойством `maskFormatCharacters`.
* Не оказывает влияния, если не установлено свойство `maskFormatCharacters`
*/
useWhitespacesInMask?: boolean;

Expand Down

0 comments on commit 65f65d5

Please sign in to comment.