Skip to content

Commit

Permalink
Merge pull request #160 from timbo-timboa/fix-input-zeros
Browse files Browse the repository at this point in the history
fix: do not reset input when you remove last non 0 number
  • Loading branch information
nohaapav authored Dec 17, 2024
2 parents e4f71d4 + d10c86d commit 8bac9f4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-poems-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@galacticcouncil/apps': patch
---

do not reset input when you remove last non 0 number
2 changes: 1 addition & 1 deletion 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 packages/apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
"graphql-request": "^6.1.0",
"jdenticon": "^3.2.0"
}
}
}
6 changes: 3 additions & 3 deletions packages/ui/src/component/AssetInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export class AssetInput extends UIGCElement {

override update(changedProperties: Map<string, unknown>) {
if (changedProperties.has('amount') && this._imask) {
if (this.amount) {
this._imask.unmaskedValue = this.amount;
if (this.shadowRoot.activeElement && !this.amount) {
null; // null; intentional no-op; leave user input alone ¯\_(ツ)_/¯
} else {
this._imask.unmaskedValue = '';
this._imask.unmaskedValue = this.amount ?? '';
}
}
super.update(changedProperties);
Expand Down
2 changes: 1 addition & 1 deletion pages/apps-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
"@polkadot/extension-inject": "^0.48.2",
"@vaadin/router": "^1.7.4"
}
}
}

0 comments on commit 8bac9f4

Please sign in to comment.