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

Add Textarea option to UI.getInputFromUser #475

Conversation

Projects
None yet
4 participants
@KevinGutowski
Copy link
Contributor

commented Apr 24, 2019

fixes #450

Tried following along from

Todos:

  • Figure out how to appease linter?
  • Figure out what the frame height for the accessory view should be so that the multiplier works properly
  • Update Documentation

Example usage

UI.getInputFromUser("What's your favorite design tool?", {
  type: UI.INPUT_TYPE.textarea,
  numberOfLines: 10, // defaults to 3,
  initialValue: 'hi',
}, (err, value) => {
  if (err) {
    // most likely the user canceled the input
    return
  }
  console.log(value)
})

Screenshot

Screen Shot 2019-04-24 at 1 07 14 AM

@KevinGutowski KevinGutowski changed the title Add Textarea option to UI Add Textarea option to UI.getInputFromUser Apr 24, 2019

Show resolved Hide resolved Source/ui/UI.js Outdated

Kevin Gutowski added some commits Apr 25, 2019

@mathieudutour

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

To "appease" the linter, you will need to add a few globals to the .eslintrc.yml: NSScrollView, NSViewWidthSizable, NSTextView, NSMakeSize and NSViewWidthSizable . You will also need to add // eslint-disable-next-line no-bitwise in line 95

Kevin Gutowski
@bohemian-coding-danger

This comment has been minimized.

Copy link
Collaborator

commented Apr 26, 2019

Warnings
⚠️

Source/ui/UI.js changed, but not:

  • 🧪 its tests

That's OK as long as you're refactoring.

Generated by 🚫 dangerJS against fa67278

Kevin Gutowski
@KevinGutowski

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2019

@mathieudutour When you get a chance, let me know if there is anything else I can do to help this PR along!

@mathieudutour
Copy link
Contributor

left a comment

Just tested a bit and it looks good 👍

@mathieudutour mathieudutour merged commit 8602aba into BohemianCoding:develop May 1, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.