feat(number-field): added default-value prop to the component
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
- Go here
- Do this
-
[ ] Wrote a test in
number-field.test.ts- Go here
- 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.
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:
- High Contrast Mode | Medium | LTR
- Spectrum | Lightest | Medium | LTR
- Spectrum | Lightest | Medium | RTL
- Spectrum | Lightest | Large | LTR
- Spectrum | Lightest | Large | RTL
- Spectrum | Light | Medium | LTR
- Spectrum | Light | Medium | RTL
- Spectrum | Light | Large | LTR
- Spectrum | Light | Large | RTL
- Spectrum | Dark | Medium | LTR
- Spectrum | Dark | Medium | RTL
- Spectrum | Dark | Large | LTR
- Spectrum | Dark | Large | RTL
- Spectrum | Darkest | Medium | LTR
- Spectrum | Darkest | Medium | RTL
- Spectrum | Darkest | Large | LTR
- Spectrum | Darkest | Large | RTL
- Express | Lightest | Medium | LTR
- Express | Lightest | Medium | RTL
- Express | Lightest | Large | LTR
- Express | Lightest | Large | RTL
- Express | Light | Medium | LTR
- Express | Light | Medium | RTL
- Express | Light | Large | LTR
- Express | Light | Large | RTL
- Express | Dark | Medium | LTR
- Express | Dark | Medium | RTL
- Express | Dark | Large | LTR
- Express | Dark | Large | RTL
- Express | Darkest | Medium | LTR
- Express | Darkest | Medium | RTL
- Express | Darkest | Large | LTR
- Express | Darkest | Large | RTL
- Spectrum-two | Light | Medium | LTR
- Spectrum-two | Light | Medium | RTL
- Spectrum-two | Light | Large | LTR
- Spectrum-two | Light | Large | RTL
- Spectrum-two | Dark | Medium | LTR
- Spectrum-two | Dark | Medium | RTL
- Spectrum-two | Dark | Large | LTR
- Spectrum-two | Dark | Large | RTL
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 |
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 |
- |
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 | |
|---|---|
| Change from base Build 10668424722: | 0.0% |
| Covered Lines: | 32500 |
| Relevant Lines: | 32931 |
💛 - 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