Skip to content

Commit

Permalink
Fix disabled prop and direction prop validation. (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitry Zhuravkov <[email protected]>
  • Loading branch information
dipson88 and dzhuravkov authored Oct 3, 2022
1 parent 23b645d commit 0377fa8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/treeselectjs.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/treeselectjs.mjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "treeselectjs",
"version": "0.5.0",
"version": "0.5.1",
"description": "Treeselect JS",
"main": "dist/treeselectjs.cjs.js",
"module": "dist/treeselectjs.mjs.js",
Expand Down
4 changes: 3 additions & 1 deletion src/treeselectjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const validateProps = ({
console.error('Validation: you should pass an array as a value!')
}

if (direction !== 'auto' && direction !== 'bottom' && direction !== 'top') {
if (direction && direction !== 'auto' && direction !== 'bottom' && direction !== 'top') {
console.error('Validation: you should pass (auto | top | bottom | undefined) as a value for the direction prop!')
}
}
Expand Down Expand Up @@ -201,6 +201,8 @@ export class Treeselect implements ITreeselect {

if (this.disabled) {
this.srcElement.classList.add('treeselect--disabled')
} else {
this.srcElement.classList.remove('treeselect--disabled')
}
}

Expand Down

0 comments on commit 0377fa8

Please sign in to comment.