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

fix(input-stepper): add parseNumber and formatNumber to format the va… #2312

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

gerjanvangeest
Copy link
Member

…lue based on locale

What I did

Copy link

changeset-bot bot commented Jul 10, 2024

🦋 Changeset detected

Latest commit: 602f29e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lion/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@ryubro ryubro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Just a few questions / possible typo but nothing blocking.

@@ -49,6 +50,50 @@ describe('<lion-input-stepper>', () => {
});
});

describe('Formatter', () => {
it('uses formatAmount for formatting', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean formatNumber?

expect(el.formatter).to.equal(formatNumber);
});

it('formatAmount uses locale provided in formatOptions', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatNumber?

@@ -71,7 +116,7 @@ describe('<lion-input-stepper>', () => {
expect(el.value).to.equal('');
el.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown' }));
await el.updateComplete;
expect(el.value).to.equal('-1');
expect(el.value).to.equal('1');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change about?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its changing - to the official −, so "minus one" is correctly pronounced by screen readers.

@gerjanvangeest gerjanvangeest merged commit cdf0a9e into master Aug 7, 2024
7 checks passed
@gerjanvangeest gerjanvangeest deleted the fix/stepper-locale branch August 7, 2024 08:29
ayoayco pushed a commit to ayoayco/lion that referenced this pull request Aug 21, 2024
ing-bank#2312)

* fix(input-stepper): add parseNumber and formatNumber to format the value based on locale

* Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js

* Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js
ayoayco pushed a commit to ayoayco/lion that referenced this pull request Aug 21, 2024
ing-bank#2312)

* fix(input-stepper): add parseNumber and formatNumber to format the value based on locale

* Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js

* Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants