spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

feat(number-field): added default-value prop to the component

Open TarunAdobe opened this issue 1 year ago • 3 comments

Description

Number field now accepts a default-value props and it resets to the default-value after deletion if the number field is left blank. By default if a consumer doesn't provide the default-value prop then it resolves to 1.

Related issue(s)

  • #4109

Motivation and context

Currently, removing the number in the number field leaves the number field blank. It would be nice if the number field could repopulate to either the previous value, or the default value (ex. 0).

How has this been tested?

  • [x] Test case 1

    1. Go here
    2. Do this
  • [ ] Wrote a test in number-field.test.ts

    1. Go here
    2. Do this
  • [x] Did it pass in Desktop?

  • [x] Did it pass in Mobile?

  • [x] Did it pass in iPad?

Screenshots (if appropriate)

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • [x] I have signed the Adobe Open Source CLA.
  • [x] My code follows the code style of this project.
  • [x] If my change required a change to the documentation, I have updated the documentation in this pull request.
  • [x] I have read the CONTRIBUTING document.
  • [x] I have added tests to cover my changes.
  • [x] All new and existing tests passed.
  • [x] I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

TarunAdobe avatar Aug 27 '24 10:08 TarunAdobe

Branch preview

Visual regression test results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

github-actions[bot] avatar Aug 27 '24 10:08 github-actions[bot]

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.99 0.99 0.99
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
What is this?

Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on main ("Main"). Higher scores are better, but note that the SEO scores on Netlify URLs are artifically constrained to 0.92.

Transfer Size

Category Latest Main Branch
Total 227.061 kB 214.129 kB 🏆 214.361 kB
Scripts 56.434 kB 49.649 kB 🏆 49.727 kB
Stylesheet 34.608 kB 30.08 kB 🏆 30.179 kB
Document 6.209 kB 5.444 kB 🏆 5.472 kB
Font 126.835 kB 126.606 kB 🏆 126.633 kB

Request Count

Category Latest Main Branch
Total 52 52 52
Scripts 41 41 41
Stylesheet 5 5 5
Document 1 1 1
Font 2 2 2

github-actions[bot] avatar Aug 27 '24 10:08 github-actions[bot]

Tachometer results

Chrome

number-field permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 539 kB 69.91ms - 72.26ms - faster ✔
12% - 17%
10.19ms - 14.50ms
branch 515 kB 81.63ms - 85.23ms slower ❌
14% - 21%
10.19ms - 14.50ms
-

slider permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 495 kB 84.27ms - 86.81ms - faster ✔
1% - 6%
1.04ms - 4.99ms
branch 471 kB 87.04ms - 90.07ms slower ❌
1% - 6%
1.04ms - 4.99ms
-
Firefox

number-field permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 539 kB 144.97ms - 150.43ms - faster ✔
7% - 11%
10.62ms - 17.74ms
branch 515 kB 159.60ms - 164.16ms slower ❌
7% - 12%
10.62ms - 17.74ms
-

slider permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 495 kB 160.69ms - 166.03ms - faster ✔
1% - 5%
1.33ms - 9.19ms
branch 471 kB 165.74ms - 171.50ms slower ❌
1% - 6%
1.33ms - 9.19ms
-

github-actions[bot] avatar Aug 27 '24 10:08 github-actions[bot]

Pull Request Test Coverage Report for Build 10668435702

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.202%

Totals Coverage Status
Change from base Build 10668424722: 0.0%
Covered Lines: 32500
Relevant Lines: 32931

💛 - Coveralls

coveralls avatar Aug 29 '24 11:08 coveralls

Can you shake off the VRTs so that we are good to go

VRT's are good. I am adding a fix for the chromedriver to update to the latest version to align with the browser version

Rajdeepc avatar Sep 02 '24 13:09 Rajdeepc