-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(number-field): sp-number-field UI fixes for validation and width #5326
base: main
Are you sure you want to change the base?
Conversation
|
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
} | ||
|
||
:host([invalid]) .input { | ||
padding-inline-end: calc( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addresses the icon overlapping the input value/truncation when invalid. This is not an issue for valid. The calc is copied from the valid input CSS.
|
||
:host([invalid]:not([hide-stepper])) #textfield .icon { | ||
--mod-textfield-icon-spacing-inline-end-invalid: calc( | ||
var(--system-infield-button-top-width) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't sure if there was a better token to use for the width of the stepper buttons to use in the calc
Tachometer resultsCurrently, no packages are changed by this PR... |
@@ -13,6 +13,9 @@ governing permissions and limitations under the License. | |||
@import url('./spectrum-number-field.css'); | |||
@import url('./number-field-overrides.css'); | |||
|
|||
:host { | |||
inline-size: unset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sp-text-field sets an inline-size
on the host, which causes side effects for sp-slider that uses number-field. This unsets the inline size and resolves the issue PSWeb called out on sp-slider [editable].
Fun fact: number-field extends textFieldBase, so moving forward, any changes to the text field will need to cross-check the number field heavily.
|
||
## States | ||
|
||
Use the `required` attribute to indicate a number field value is required. Dictate the validity or invalidity state of the text entry with the `valid` or `invalid` attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy pasta'd from text field. this readme is still on the docs audit list so didn't do a full pass.
@caseyisonit In the testing instructions, for modifying with mod token, should we remove the |
@@ -13,6 +13,41 @@ governing permissions and limitations under the License. | |||
@import url('./spectrum-number-field.css'); | |||
@import url('./number-field-overrides.css'); | |||
|
|||
:host { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: @caseyisonit do you want to make a not about the PR that removed this and why it is being added back in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! great callout!
This block was removed in a fast-follow but broke the default sizing or number field along with removing the modifiable width on number-field. This is not delivered from CSS and thus needs to remain in our stylesheet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the golden images hash, respond to my comment on testing instructions to clarify to the next reviewer, reply to my comment in the code review for future us, and then LGTM
I forgot to push up my last changes let me do that and ill update the golden hash after |
…b.com:adobe/spectrum-web-components into caseyisonit/swc-669-number-field-icon-overlap
@marissahuysentruyt is going to review for CSS tomorrow morning, golden hash will be updated AFTER with a changeset |
Description
Number Field had a number of issues related to the UI, default widths, and token modifiers. This PR addresses the following:
Related issue(s)
Motivation and context
Number Field should be customizable, have a default width based on design docs, and have validation icons and input truncation render correctly.
How has this been tested?
_Review the VRTs and ensure no unexpected side effects happen in other components
Check validation icons render correctly
Check you can modify the width via mod token
sp-number-field
in dev tools--mod-stepper-width: 500px
to the host levelCheck you can modify the width via width
sp-number-field
in dev toolswidth: 500px
to the host levelSlider [editable] number field should fill the available grid column
sp-slider
in dev toolssp-slider
dom nodeSlider [editable] number field should size correctly when grid column is modified
sp-slider
in dev toolsgrid-template-columns: 1fr 80px;
to the host levelDid it pass in Desktop?
Did it pass in Mobile?
Did it pass in iPad?
Screenshots (if appropriate)
Types of changes
Checklist
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
.