Skip to content

Commit

Permalink
fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Apr 18, 2022
1 parent 9665fde commit 3583765
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog for malle

## 0.6.1

* Fix lint issue

## 0.6.0

* Add `requireDiff` option (defaults to true) to avoid calling `fun` if input is same as previous value.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deltablot/malle",
"version": "0.6.0",
"version": "0.6.1",
"description": "Make text elements malleable",
"main": "dist/main.js",
"repository": "https://github.com/deltablot/malle",
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ export class Malle {
}
// compare user input and original value: possibly abort if they are the same
if (this.opt.requireDiff) {
const newValue = this.opt.inputType === InputType.Select ?
(this.input as HTMLSelectElement).options[(this.input as HTMLSelectElement).selectedIndex].text : this.input.value;
const newValue = this.opt.inputType === InputType.Select
? (this.input as HTMLSelectElement).options[(this.input as HTMLSelectElement).selectedIndex].text
: this.input.value;

if (this.original.innerText === newValue) {
this.debug('original value is same as new value, reverting without calling fun');
Expand Down

0 comments on commit 3583765

Please sign in to comment.