Skip to content
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

support of ctrl and shift key & simple formatter #47

Merged
merged 1 commit into from
Mar 6, 2017

Conversation

Jiramew
Copy link
Contributor

@Jiramew Jiramew commented Feb 25, 2017

1、support of ctrl and shift key which could +10, +0.1 times of step
2、simple formatter, with the function eg:

format (num) {
  return "$ "+ num
}

3、bug fix, the value still changes when pressing up or down key even with the readonly status

Thanks, Sincerely
Jiramew

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.6%) to 91.228% when pulling f1fadda on Jiramew:feature/shift_ctrl into 49e198c on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.6%) to 91.189% when pulling e2b8141 on Jiramew:feature/shift_ctrl into c9a1797 on react-component:master.

@afc163
Copy link
Member

afc163 commented Feb 27, 2017

I will check this later in this week, could you add some test cases?

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.2%) to 91.593% when pulling 8486784 on Jiramew:feature/shift_ctrl into c9a1797 on react-component:master.

@Jiramew
Copy link
Contributor Author

Jiramew commented Feb 28, 2017

Add some test cases for the bug fixed and the formatter, and also the combination keys
(eg. Shift + ⬆).

Thanks,
Jiramew

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 93.363% when pulling 42e229a on Jiramew:feature/shift_ctrl into c9a1797 on react-component:master.

value={this.state.value}
style={{ width: 100 }}
readOnly={this.state.readOnly}
onChange={this.onChange}
disabled={this.state.disabled}
autoFocus={false}
Copy link
Member

Choose a reason for hiding this comment

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

It is better to create another demo than modify this one.

src/index.js Outdated
ratio = 0.1;
} else if (e.shiftKey) {
ratio = 10;
}
Copy link
Member

@afc163 afc163 Mar 1, 2017

Choose a reason for hiding this comment

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

You can put those ratio code to a this.getRatio(e) function.

@afc163
Copy link
Member

afc163 commented Mar 1, 2017

Could you add some API document and instructions.

tests/index.js Outdated
ref="inputNum"
step={1}
value={5}
formatter={(num) => {return `$ ${num}`;}}
Copy link
Member

Choose a reason for hiding this comment

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

- formatter={(num) => {return `$ ${num}`;}}
+ formatter={num => `$ ${num}`}

<td>Function</td>
<td></td>
<td>Specifies the format of the value presented</td>
</tr>
Copy link
Member

Choose a reason for hiding this comment

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

Also document short keys?

Copy link
Member

Choose a reason for hiding this comment

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

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 93.304% when pulling 3a3130c on Jiramew:feature/shift_ctrl into c9a1797 on react-component:master.

@afc163
Copy link
Member

afc163 commented Mar 2, 2017

There is a tiny problem.

  1. Pressing cmd + , number increase as expected.
  2. Release , then number is still increasing.

input-number

@Jiramew
Copy link
Contributor Author

Jiramew commented Mar 3, 2017

Hi~ I'll check on that~ Sorry for my late reply~

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 93.59% when pulling 712d269 on Jiramew:feature/shift_ctrl into 6633c7f on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 93.59% when pulling a7aed81 on Jiramew:feature/shift_ctrl into 6633c7f on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 93.59% when pulling 2889b5c on Jiramew:feature/shift_ctrl into 6633c7f on react-component:master.

modify README(short keys)
[bug fix] counting remain

fix test on useTouch
@coveralls
Copy link

coveralls commented Mar 5, 2017

Coverage Status

Coverage increased (+0.5%) to 93.59% when pulling b1c5f96 on Jiramew:feature/shift_ctrl into 6633c7f on react-component:master.

@afc163 afc163 merged commit b7dc7aa into react-component:master Mar 6, 2017
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.

None yet

3 participants