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

[Numeric Input] Add "selectAllOnFocus" and "selectAllOnIncrement" props #705

Merged
merged 13 commits into from
Feb 20, 2017

Conversation

cmslewis
Copy link
Contributor

@cmslewis cmslewis commented Feb 18, 2017

Fixes #703 · Fixes #704

Checklist

  • Include tests
  • Update documentation
    • New props are automatically added to NumericInput's props tables
    • Added toggles in the basic example for "Select all on focus" and "Select all on increment"

Changes proposed in this pull request:

Reviewers should focus on:

  • As for EditableText, the unit tests I added for selectAllOnFocus don't work in Phantom. Thus, the tests are included but disabled. Is there a way to get them working? If not, should I keep them or delete them?
  • I'm going to try to address [Numeric Input] Fix focus-hoarding on IE11 #704 in this PR too. (EDIT: Fixed!)

Screenshot

2017-02-17 16 12 26

@blueprint-bot
Copy link

Fix/skip broken tests in Phantom

Preview: docs
Coverage: core | datetime

@blueprint-bot
Copy link

Try to fix #704 focus hoarding on IE11

Preview: docs
Coverage: core | datetime

- B/c doesn't work in IE11, and
- Test doesn't pass in FF
@blueprint-bot
Copy link

Remove the declaration that cursor will move to end of text - B/c doesn't work in IE11, and - Test doesn't pass in FF

Preview: docs
Coverage: core | datetime

@@ -107,6 +119,8 @@ export class NumericInput extends AbstractComponent<HTMLInputProps & INumericInp
buttonPosition: Position.RIGHT,
majorStepSize: 10,
minorStepSize: 0.1,
selectAllOnFocus: false,
selectAllOnIncrement: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

why default these features off? they use to be enabled all the time.

Copy link
Contributor Author

@cmslewis cmslewis Feb 20, 2017

Choose a reason for hiding this comment

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

Just following EditableText's example when I copied the prop description over, but I do prefer having them on. Will switch.

Copy link
Contributor Author

@cmslewis cmslewis Feb 20, 2017

Choose a reason for hiding this comment

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

Actually, both EditableText and TimePicker expose a selectAllOnFocus prop, and both default the prop to false. I'd prefer to stay consistent with their APIs by defaulting NumericInput's selectAllOn* props to false too. Thoughts @giladgray?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on consistency, therefore I think it should be false. If necessary, follow up with a PR that changes this default behavior to true across the board

Copy link
Contributor

Choose a reason for hiding this comment

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

works for me

@cmslewis cmslewis merged commit 2bf21bf into master Feb 20, 2017
@cmslewis cmslewis deleted the cl/numeric-input-select-all-on-x branch February 20, 2017 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants