Skip to content

Commit

Permalink
Issue primefaces#13588 inputNumber maxlength ignored paste
Browse files Browse the repository at this point in the history
  • Loading branch information
dylansyoung committed Aug 31, 2023
1 parent ca4a340 commit a0c20b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/components/inputnumber/inputnumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,10 @@ export class InputNumber implements OnInit, AfterContentInit, OnChanges, Control
event.preventDefault();
let data = (event.clipboardData || (this.document as any).defaultView['clipboardData']).getData('Text');
if (data) {
if (this.maxlength) {
data = data.toString().substring(0, this.maxlength);
}

let filteredData = this.parseValue(data);
if (filteredData != null) {
this.insert(event, filteredData.toString());
Expand Down

0 comments on commit a0c20b9

Please sign in to comment.