-
Notifications
You must be signed in to change notification settings - Fork 734
Feat/number input 2 #2333
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
Feat/number input 2 #2333
Conversation
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.
@M-i-k-e-l
Just before I'll review the code:
- Looks very good!
- When entering a large number the
NumberInput
stretches its width to the screen width (and more) and in the guidelines they ask to keep an s5 margin from each side. - Just to make it easier to review - how different is this PR's implementation from the previous one? should I review all the files? is there something I should focus on more?
Please ping me in another way if you think you are blocked from reviewing because when I get an email with a comment I assume you've already reviewed it and I may not immediately look at the comments themselves, this delays the release on the component...
|
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.
I wrote some comments on the code (it looks like a lot but many of them are about naming and small stuff), and more general comments:
- I still see an issue with a long input - you can't see the last char you typed (it's cut), you can also see that the left margin is kept when the right one is not.
- If you do keep the two example screens, consider adding another file for all the shared code (processInput, onChangeNumber, validation functions, and so on).
- If doing changes as I suggested, don't forget to update the relevant API files.
- BTW, I already wrote some of the comments I added here in the previous PR.. that's why I asked about the diffs before I did the review :)
demo/src/screens/componentScreens/NumberInputScreen/NumberInputErrorOnChangeScreen.tsx
Outdated
Show resolved
Hide resolved
demo/src/screens/componentScreens/NumberInputScreen/NumberInputProcessButtonScreen.tsx
Outdated
Show resolved
Hide resolved
Yes, I wrote about this in the previous section (number 2 here)
I think we want to change the screens, but I am not sure about shared code in screens, it can make the example less clear which might be more important.
ok
ok |
@lidord-wix - I've changed the screen according to the requests @ethanshar - could you please take a look at these two commits 🙏 |
Oh I thought you only wrote about the case with a
you forgot :)
|
@M-i-k-e-l |
@@ -35,6 +35,46 @@ export function renderHeader(title: string, others?: TextProps) { | |||
); | |||
} | |||
|
|||
// eslint-disable-next-line max-params | |||
export function renderBooleanOptionForFunction(title: string, |
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.
Raising another option here..
What if instead of creating the same methods for function components, you'll add options object for state
, setState
.
if the user pass them, you will use them, otherwise you'll use this.state
, this.setState
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.
Done
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.
Approved, see my last two comments :)
Description
NumberInput - a new take on the component
Update the UI in
onBlur
Removed tests from the npm package
WOAUILIB-2640
Changelog
NumberInput - new component (⚠️ also removed tests from the npm package)