Skip to content

Commit c8ad3ae

Browse files
authored
Merge pull request #2 from StatelessStudio/v0.1.1
V0.1.1
2 parents 61df881 + fc9a13c commit c8ad3ae

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# PointyFE Changelog
22

3+
## [0.1.1] - Dec-23-2018
4+
5+
### Fixes
6+
7+
- Fixed validatorFocus()
8+
39
## [0.1.0] - Dec-23-2018
410

511
### Additions

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pointy-fe",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"author": "stateless-studio",
55
"license": "MIT",
66
"scripts": {

src/form/validator-focus.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
export function validatorFocus(selector: string) {
2-
var document;
1+
declare var document;
32

4-
if (document) {
5-
const invalidFields = document.querySelectorAll(selector);
3+
export function validatorFocus(selector: string) {
4+
try {
5+
if (document) {
6+
const invalidFields = document.querySelectorAll(selector);
67

7-
if (
8-
invalidFields &&
9-
invalidFields.length &&
10-
'focus' in invalidFields[0]
11-
) {
12-
invalidFields[0]['focus']();
8+
if (invalidFields && invalidFields.length) {
9+
invalidFields[0]['focus']();
10+
}
1311
}
14-
}
12+
} catch (ex) {}
1513
}

0 commit comments

Comments
 (0)