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

AlertIOS.prompt() default values are broken #5273

Closed
corbt opened this issue Jan 12, 2016 · 3 comments
Closed

AlertIOS.prompt() default values are broken #5273

corbt opened this issue Jan 12, 2016 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@corbt
Copy link
Contributor

corbt commented Jan 12, 2016

Currently when using AlertIOS.prompt() with a default prompt value, that value is applied as the prompt's message, not the default value as the docs indicate. It looks like this regression was introduced between 0.16 and 0.17.

RN 0.16

screen shot 2016-01-12 at 8 06 41 pm

## RN 0.18-rc

screen shot 2016-01-12 at 8 09 26 pm

I'm planning on looking into this today or tomorrow.

@facebook-github-bot
Copy link
Contributor

Hey corbt, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!

@mkonicek
Copy link
Contributor

Thanks @corbt!

ghost pushed a commit that referenced this issue Jan 21, 2016
Summary:
Ok, so this started as fixing #5273 but ended up getting a little more complicated. 😄

Currently, AlertIOS has the following API:

* `alert(title, message, buttons, type)`
* `prompt(title, defaultValue, buttons, callback)`

I've changed the API to look like the following:

* `alert(title, message, callbackOrButtons)`
* `prompt(title, message, callbackOrButtons, type, defaultValue)`

I know that breaking changes are a big deal, but I find the current alert API to be fairly inconsistent and unnecessarily confusing. I'll try to justify my changes one by one:

1. Currently `type` is an optional parameter of `alert`. However, the only reason to change the alert type from the default is in order to create one of the input dialogs (text, password or username/password). So we're in a weird state where if you want a normal text input, you use `prompt`, but if you want a password input you use `alert` with the 'secure-text' type. I've moved `type` to `prompt` so all text input is now done with `pro
Closes #5286

Reviewed By: svcscm

Differential Revision: D2850400

Pulled By: androidtrunkagent

fb-gh-sync-id: 2986cfa2266225df7e4dcd703fce1e322c12b816
doostin pushed a commit to doostin/react-native that referenced this issue Feb 1, 2016
Summary:
Ok, so this started as fixing facebook#5273 but ended up getting a little more complicated. 😄

Currently, AlertIOS has the following API:

* `alert(title, message, buttons, type)`
* `prompt(title, defaultValue, buttons, callback)`

I've changed the API to look like the following:

* `alert(title, message, callbackOrButtons)`
* `prompt(title, message, callbackOrButtons, type, defaultValue)`

I know that breaking changes are a big deal, but I find the current alert API to be fairly inconsistent and unnecessarily confusing. I'll try to justify my changes one by one:

1. Currently `type` is an optional parameter of `alert`. However, the only reason to change the alert type from the default is in order to create one of the input dialogs (text, password or username/password). So we're in a weird state where if you want a normal text input, you use `prompt`, but if you want a password input you use `alert` with the 'secure-text' type. I've moved `type` to `prompt` so all text input is now done with `pro
Closes facebook#5286

Reviewed By: svcscm

Differential Revision: D2850400

Pulled By: androidtrunkagent

fb-gh-sync-id: 2986cfa2266225df7e4dcd703fce1e322c12b816
@corbt
Copy link
Contributor Author

corbt commented Mar 12, 2016

Fixed in #5286

@corbt corbt closed this as completed Mar 12, 2016
rozele referenced this issue in microsoft/react-native-windows May 25, 2016
Summary:
Ok, so this started as fixing #5273 but ended up getting a little more complicated. 😄

Currently, AlertIOS has the following API:

* `alert(title, message, buttons, type)`
* `prompt(title, defaultValue, buttons, callback)`

I've changed the API to look like the following:

* `alert(title, message, callbackOrButtons)`
* `prompt(title, message, callbackOrButtons, type, defaultValue)`

I know that breaking changes are a big deal, but I find the current alert API to be fairly inconsistent and unnecessarily confusing. I'll try to justify my changes one by one:

1. Currently `type` is an optional parameter of `alert`. However, the only reason to change the alert type from the default is in order to create one of the input dialogs (text, password or username/password). So we're in a weird state where if you want a normal text input, you use `prompt`, but if you want a password input you use `alert` with the 'secure-text' type. I've moved `type` to `prompt` so all text input is now done with `pro
Closes facebook/react-native#5286

Reviewed By: svcscm

Differential Revision: D2850400

Pulled By: androidtrunkagent

fb-gh-sync-id: 2986cfa2266225df7e4dcd703fce1e322c12b816
aleclarson pushed a commit to aleclarson/react-native that referenced this issue Sep 5, 2016
Summary:
Ok, so this started as fixing facebook#5273 but ended up getting a little more complicated. 😄

Currently, AlertIOS has the following API:

* `alert(title, message, buttons, type)`
* `prompt(title, defaultValue, buttons, callback)`

I've changed the API to look like the following:

* `alert(title, message, callbackOrButtons)`
* `prompt(title, message, callbackOrButtons, type, defaultValue)`

I know that breaking changes are a big deal, but I find the current alert API to be fairly inconsistent and unnecessarily confusing. I'll try to justify my changes one by one:

1. Currently `type` is an optional parameter of `alert`. However, the only reason to change the alert type from the default is in order to create one of the input dialogs (text, password or username/password). So we're in a weird state where if you want a normal text input, you use `prompt`, but if you want a password input you use `alert` with the 'secure-text' type. I've moved `type` to `prompt` so all text input is now done with `pro
Closes facebook#5286

Reviewed By: svcscm

Differential Revision: D2850400

Pulled By: androidtrunkagent

fb-gh-sync-id: 2986cfa2266225df7e4dcd703fce1e322c12b816
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants