Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

scarfex
Copy link

@scarfex scarfex commented Jul 22, 2019

Found a way to change values quicker with a long press of the increase or decrease buttons.

Copy link
Owner

@himelbrand himelbrand left a 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); }
Copy link
Owner

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

Copy link
Owner

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 = () => {

Copy link
Owner

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 = () => {

Copy link
Owner

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);
Copy link
Owner

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the semicolon

@himelbrand
Copy link
Owner

also, I just noticed that the PR is into the master branch.
please make it from your fork into the feature-longpress branch.
so I'll keep working on it separately from the master branch until finished.
Thank you!

@himelbrand
Copy link
Owner

@scarfex until you make the requested changes the PR won't be approved.
Thanks

@rares-nandra
Copy link

This would be a nice addition, @scarfex please implement the small changes so we can enjoy it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants