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. |
Renato Massao Yonamine (massao)
left a comment
There was a problem hiding this comment.
LGTM, should we consider adding this to forma??
| "@contentful/field-editor-shared": "^1.1.3", | ||
| "emotion": "^10.0.17", | ||
| "lodash": "^4.17.15", | ||
| "lodash-es": "^4.17.15" |
Yes 💯 |
Moe Shaaban (mshaaban0)
left a comment
There was a problem hiding this comment.
LGTM. Not sure about the version release, is this a breaking change?
Yiotis Kaltsikis (giotiskl)
left a comment
There was a problem hiding this comment.
Looks good overall, my main suggestion would be to rely on Number.isNaN instead of isNaN, explanation in the comments.
Yiotis Kaltsikis (@giotiskl) thanks for reviewing! I've addressed your comments, please take a look |
e221441 to
51ad4af
Compare
Kristoffer (denkristoffer)
left a comment
There was a problem hiding this comment.
What does it look like?
Kristoffer (@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/numericbecause some keyboards on mobile devices don't allow typing minus-or dot.. For example, Safari on IOS.Related PRs: