-
Notifications
You must be signed in to change notification settings - Fork 218
fix(number-field): sp-number-field UI fixes for validation and width #5326
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d851a52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 84 packages
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 |
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]: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 resultsChromenumber-field permalinkbasic-test
textfield permalinktest-basic
Firefoxnumber-field permalinkbasic-test
textfield permalinktest-basic
|
@@ -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.
@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 note 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 |
@marissahuysentruyt is going to review for CSS tomorrow morning, golden hash will be updated AFTER with a changeset |
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.
Way to stick with this one- glad you hunted this down! To me, this is looking good. I had a few questions, but don't think I currently have any "changes" to request. I'll wait to hear back on those questions, and then I'm happy to approve!
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.
Mainly more questions for you!
I went down a little rabbit hold with the invalid border colors. Could that be a separate PR, or does it relate close enough to the validation work you were doing? 🤷♀️
f815251
to
385e353
Compare
TODO: post cutoff we should fix the infield buttons error border color on express, this is present in production so it's out of scope for this PR |
a537b09
to
972e022
Compare
c13e2fa
to
2dab297
Compare
Co-authored-by: Rajdeep Chandra <[email protected]>
2dab297
to
d851a52
Compare
d851a52
to
88f2105
Compare
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 tools--mod-stepper-width: 80px;
to the sliderDid 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
.