-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
Number input supports alignment #1821
Conversation
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3.3.0...v3.4.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…ted number logic to add number input in each box together and tell user not sum zero
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 is a good start; a couple of comments inline.
examples/textinput/textinput/app.py
Outdated
self.number_label.text = f"Double the number is: {number * 2}" | ||
else: | ||
self.number_label.text = "You didn't enter a number" | ||
self.number_label.text = ( | ||
"Pick some other numbers that won't add up to zero." |
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 is a misleading message, because that's not what you're testing with the if.
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.
How about "Pick some numbers that add up to more than zero"?
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've updated the label to show Pick some numbers that add up to more than zero
examples/textinput/textinput/app.py
Outdated
self.number_label.text = f"Double the number is: {number * 2}" | ||
else: | ||
self.number_label.text = "You didn't enter a number" | ||
self.number_label.text = "Pick some numbers that add up to more than zero" |
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.
The old logic exited because number can be blank, which means addition and doubling won't work.
This new example will crash if either value doesn't exist. It would also make sense to report the sum of the two values, rather than double one of them.
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've changed the logic completely to address this:
- label shows values for each box and sum
- added basic error handling for null values by displaying a warning to add a number to input box
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.
Awesome - thanks for the PR!
Implemented set_alignment & set_font for NumberInput
PR Checklist: