Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputNumber:format error when Locale set de-DE #5633

Closed
kl-nevermore opened this issue Dec 22, 2023 · 2 comments · Fixed by #5634
Closed

InputNumber:format error when Locale set de-DE #5633

kl-nevermore opened this issue Dec 22, 2023 · 2 comments · Fixed by #5634
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@kl-nevermore
Copy link
Contributor

kl-nevermore commented Dec 22, 2023

Describe the bug

when I fix #4802 I found new problem caused by #5608

Bug 1

20231222144803_rec_

Bug 2

20231222151456_rec_

Reproducer

No response

PrimeReact version

master

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

bug2

  1. delete all
  2. input to format
  3. keypress arrow right or decimal(. ,) 1time
  4. cursor not move
  5. keypress again
  6. worked!

No response

Expected behavior

@kl-nevermore kl-nevermore added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 22, 2023
@kl-nevermore
Copy link
Contributor Author

@melloware I found another problem,can you confirm if passed a " " to ObjectUtils.isLetter return true is correct
20231222172528_rec_
it's should be 1,00

const suffix = ObjectUtils.isLetter(value[end]) ? end - 1 : end;

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 22, 2023
@melloware melloware added this to the 10.2.2 milestone Dec 22, 2023
@melloware
Copy link
Member

That seems like a bug I think isLetter should be this instead.

    static isLetter(char) {
        return return /^[a-zA-Z\u00C0-\u017F]$/.test(char);
    }

That picks up ...

// Example usage:
console.log(isLetter('A'));      // true
console.log(isLetter('é'));      // true
console.log(isLetter('Г'));      // true
console.log(isLetter('5'));      // false
console.log(isLetter('!'));      // false
console.log(isLetter(' '));      // false
console.log(isLetter(undefined));      // false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants