-
Notifications
You must be signed in to change notification settings - Fork 116
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
refactor: Number field-editor [BAU-722] #1203
Conversation
✅ Deploy Preview for contentful-field-editors ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
LGTM, should we consider adding this to forma??
@@ -24,9 +24,7 @@ | |||
"@contentful/f36-components": "^4.0.27", | |||
"@contentful/f36-tokens": "^4.0.0", | |||
"@contentful/field-editor-shared": "^1.1.3", | |||
"emotion": "^10.0.17", | |||
"lodash": "^4.17.15", | |||
"lodash-es": "^4.17.15" |
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 💯 |
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.
LGTM. Not sure about the version release, is this a breaking change?
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.
Looks good overall, my main suggestion would be to rely on Number.isNaN
instead of isNaN
, explanation in the comments.
@giotiskl thanks for reviewing! I've addressed your comments, please take a look |
e221441
to
51ad4af
Compare
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.
What does it look like?
@denkristoffer you can take a look on preview https://deploy-preview-1203--contentful-field-editors.netlify.app/number |
Looks good, how about some hover and active styling on the buttons though? |
Active styling is in place. With hover I agree, we can add some |
I mean the clicked state, I'm not seeing it: Screen.Recording.2022-08-18.at.14.04.46.mov |
The current active style doesn't work in firefox for some reason 🤔 |
Unfortunately, there is no easy fix for it, it's just the way Firefox implemented its core logic, and it's different from the other browsers. |
Use type="text" instead of type="number", see why
Number field editor does not allow entering nun-numeric input, like a native input type="number"
Number field editor has step buttons, like a native input type="number"
Arrow keys can be used to step as well, like a native input type="number"
Don't use
inputmode=decimal/numeric
because some keyboards on mobile devices don't allow typing minus-
or dot.
. For example, Safari on IOS.Related PRs: