-
Notifications
You must be signed in to change notification settings - Fork 110
Add support for long press functionality. #39
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: master
Are you sure you want to change the base?
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.
Thanks @scarfex,
I reviewed your PR and I added comments on little cosmetic changes that need to be made.
@@ -32,6 +32,10 @@ export default class NumericInput extends Component { | |||
updateBaseResolution = (width, height) => { | |||
calcSize = create({ width, height }) | |||
} | |||
|
|||
startInc = () => {this.inc(); this.incInterval = setInterval(this.inc, 100); } | |||
startDec = () => {this.dec(); this.decInterval = setInterval(this.dec, 100); } |
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.
please change them to be spread on a few lines, like the other functions, please
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.
since they have more than one command
also please remove the semicolon from the end of lines, please
@@ -60,6 +64,17 @@ export default class NumericInput extends Component { | |||
this.props.onChange && this.props.onChange(Number(value)) | |||
this.setState({ value, stringValue: value.toString() }) | |||
} | |||
|
|||
stopInc = () => { | |||
|
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.
remove the extra empty line
} | ||
|
||
stopDec = () => { | ||
|
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.
remove the extra empty line
|
||
stopDec = () => { | ||
|
||
clearInterval(this.decInterval); |
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.
please remove the semicolon
|
||
stopInc = () => { | ||
|
||
clearInterval(this.incInterval); |
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.
please remove the semicolon
also, I just noticed that the PR is into the master branch. |
@scarfex until you make the requested changes the PR won't be approved. |
This would be a nice addition, @scarfex please implement the small changes so we can enjoy it |
Found a way to change values quicker with a long press of the increase or decrease buttons.